MUMBAI (Reuters) - The BSE Sensex and Nifty hit record highs for a third session in a row as infrastructure companies such as Larsen & Toubro extended recent gains while lenders including Yes Bank advanced on hopes the worst was over in terms of asset quality deterioration.
Sentiment was also supported as foreign investors remained net buyers for a third consecutive session on Tuesday, though of shares worth a modest $30.80 million, bringing their net total to $135.24 million since Thursday.
Still, broader gains were capped by continued profit-taking in recent outperformers such as Tata Motors Ltd (TAMO.NS), and by falls in regional shares after a survey showed manufacturing activity in China was still contracting in April.
Analysts expect gains to be limited in the near-term as companies post their financial results and India continues its five-week-long election process.
Markets will remain shut on Thursday when Mumbai goes to the polls.
"This is the time to be cautious as markets have spiked up substantially. You will have to look out for good quality stocks, where valuation comfort is still there," said Daljeet S Kohli, head of research at IndiaNivesh Securities.
The Sensex gained 0.52 percent to close at 22,876.54. The index earlier rose as much as 0.63 percent to a record high of 22,912.52.
The Nifty closed 0.37 percent higher at 6,840.80, after gaining as much as 0.68 percent to hit a life high of 6,861.60.
Investors continued to accumulate infrastructure and capital goods stocks, with Larsen and Toubro (LART.NS) gaining 2.21 percent in a fourth consecutive winning session.
Bharat Heavy Electricals Ltd (BHEL.NS) gained 1.5 percent, adding to its 0.24 percent gain on Tuesday.
Lenders also gained on hopes the worst may be behind them in terms of asset quality which had been a drag in the sector.
Yes Bank Ltd (YESB.NS) shares rose 1.6 percent after its January-March net profit rose 18.8 percent, while provisions fell 25.9 percent to 722.9 million rupees.
Mahindra & Mahindra Ltd (MAHM.NS) gained 1.2 percent after Credit Suisse upgraded the stock to "outperform" from "neutral," saying its four-wheeler autos and commercial vehicles will benefit from even a short-lived economic recovery.
However, recent outperformers continued to see profit-taking with Tata Motors Ltd (TAMO.NS) losing 0.87 percent, adding to its 0.8 percent fall on Tuesday, while Wipro (WIPR.NS) ended 1.1 percent lower, falling for the third straight session.
Among the laggards, Cairn India Ltd (CAIL.NS) ended 3.1 percent lower, ahead of its earnings later in the day.
Reporting by Indulal PM; Editing by Anupama Dwivedi