Last week, two individuals filed the petition in the high court of the southern state of Andhra Pradesh, requesting the court ask the market regulator and the two main stock exchanges to halt the deal and order the probe. A copy of the petition was seen by Reuters on Wednesday.
The court then ordered an "interim status quo" on the deal and asked all the involved companies, the regulator, and the stock exchanges for details, according to an order dated April 25 and seen by Reuters on the court's website on Wednesday.
Ranbaxy shares jumped 24 percent and trading volume tripled in three sessions ahead of the companies' announcement that Sun Pharma would buy the loss-making company from Japan's Daiichi Sankyo Ltd.
The Indian market regulator said this month it was seeking information from Ranbaxy and Sun Pharma on the transaction and would ask for stock exchange trading data after receiving "multiple complaints".
Sun Pharma said in a statement the company had not received any communication related to the court order. It also said that it had not violated any rules.
"The matter related to purchase of shares of Ranbaxy Laboratories Ltd does not violate Insider Trading Rules," Sun said, adding it would take "appropriate action" on the petition as advised by its lawyers.
Ranbaxy did not immediately respond to an email requesting comment. A spokesman for the market regulator, the Securities and Exchange Board of India (SEBI), said they had not received the court order and declined to comment further.
Shares in Sun Pharma, India's biggest drugmaker by market value, fell as much as 2.7 percent on Wednesday. The stock ended down 1.04 percent and Ranbaxy fell 2.01 percent, while the main Mumbai market index closed 0.3 percent lower.