Shares ended up 1% on Tuesday in broad-based buying, led by a surge in pharma stocks, even as global markets remained muted, anticipating hefty interest rate hikes from a host of central banks.
The NSE Nifty 50 index rose 1.1% to 17,816.25 and the S&P BSE Sensex ended up 0.98% at 59,719.74.
"People think that the inflation problem in India is not as severe as abroad. Other thing is that we have enough domestic liquidity. We don't have any large initial public offerings that are sucking out money," said Samrat Dasgupta, chief executive officer of Esquire Capital Investment Advisors.
"Many of the defensives have done well today on concerns of over valuation," he added.
Foreign investors on Monday sold $435.6 million worth of Indian equities, Refinitiv Eikon data showed.
Much of the foreign selling is in the large-cap space, Emkay Wealth Management said in a note.
"While the selling by overseas investors has been there in all the emerging markets, the extent to which the currency depreciated is also comparatively less in the case of the domestic economy," Emkay said.
The Nifty pharma index was the top gainer, rising 3.1%
The Nifty bank index, metals index and auto index were the other big movers, adding 1.4%, 1.6% and 1.7%, respectively.
Shares of Indian hospital chain operator Apollo Hospitals Enterprise Ltd was the top gainer in Nifty 50 index, rising 5.8%.
Meanwhile, global stocks were little changed on Tuesday, with all eyes on the U.S. Federal Reserve, which is expected to raise rates when a two-day meeting ends on Wednesday.