The BSE Sensex and Nifty rallied to record highs on Tuesday as strong buying by foreign investors continued to bolster blue chips in the lead-up to general elections, especially companies more geared towards the domestic economy such as HDFC Bank.
Still, a bout of profit-taking erased most of the gains from earlier in the session as some technical indicators such as the relative strength index indicating overbought conditions.
A powerful rally over the past month and a half - with the Nifty up 7 per cent since the end of January - has reflected hopes that the opposition Bharatiya Janata Party, perceived by markets to be more business friendly, would win elections that kick off next month, analysts have said.
A slight expansion in industrial output and a further cooling in stubbornly high inflation have also boosted investor sentiment, offsetting concerns about global risk factors, such as political tensions in Ukraine and China's economic slowdown, which have been weighing on stock markets elsewhere.
Goldman Sachs upgraded Indian shares to "overweight" from "marketweight", citing improving economic fundamentals and expectations that corporate earnings had bottomed out, recommending investors favour cyclical over defensive shares.
"Broadly it's all building up for elections, with (foreign) institutions continuously buying and creating positions," said Hansal Thacker, a director at Lalkar Securities.
"As the election nears, you will see more volatility in the markets. Profit-taking is expected at this level, but the undercurrent is firm."
India's broader NSE ended up 0.19 per cent after earlier gaining as much as 1.1 per cent to hit a record high of 6,574.95 points, surpassing its previous record high hit on March 11.
The BSE Sensex added 0.1 per cent after earlier rising as much as 1.1 per cent to an all-time high of 22,040.72 points, above its previous record hit on March 10.
Overseas funds were net buyers of $160.6 million worth of shares on Friday, marking their 20th net buying session in the previous 21, for a net total of $1.6 billion, exchange and regulatory data shows. Markets were closed on Monday for a public holiday.
Banks led gains on Tuesday, with Yes Bank Ltd rising 2.2 per cent and State Bank of India advancing 2.9 per cent.
Among other domestic-oriented blue chips, power equipment maker Bharat Heavy Electricals gained 0.6 per cent, while cigarette maker ITC rose 2.5 per cent.
Shares of Maruti Suzuki Ltd surged as much as 9.8 per cent to a record high after it said on Saturday that it would seek minority shareholder approval for a plan to outsource production at a new factory to Japan's Suzuki Motor Corp. Shares closed 7.46 per cent higher.
Shares in AstraZeneca Pharma gained 2.6 per cent after the company said its board had approved a proposal from promoter AstraZeneca Pharmaceuticals AB, Sweden, to delist the company from India.
Still, investors also booked profits in some recent outperformers. ICICI Bank fell 0.9 per cent after earlier gaining as much as 1.3 per cent, though shares in India's biggest private sector lender are still up 15.4 per cent so far this month.
Software service exporters were among the losers, continuing a trend in which they have fallen out of favour compared with domestic-focused shares. Tata Consultancy Services Ltd (TCS.NS) fell 0.8 per cent, bringing its losses so far this month to 6.8 per cent.