The headline indices swung between gains and losses as investors booked profits on recent outperformers, but defence stocks rose after the United States recognised the country as a "major defence partner" during Prime Minister Narendra Modi's ongoing US visit.
The 30-share index ended the day at 27,020, up 10.99 points, while broad-based 50-share index quoted 8,273, up 6.60 points at close.Shares have gained about 20 per cent since hitting a near two-year low on February 29 on hopes over the domestic economy and corporate earnings.
Technical indicators point to more gains ahead, with the broader NSE index last month seeing its 50-day moving average cross above the 200-day average, creating a bullish trend called the "golden cross".
Analysts however warn markets will see periodic profit-taking, especially ahead of key events this month, including the US Federal Reserve policy meeting next week and Britain's June 23 referendum on whether to leave the European Union.
"There is constant churn in the portfolio which is resulting in a regular amount of profit booking as seen in the market," said Deven Choksey, managing director of KR Choksey Securities.
Among the gainers, Bharti Airtel rose as much 2.6 per cent on news that a new spectrum usage fee for all the airwaves owned by the company would lower costs.
Defence-sector stocks, including Bharat Electronics, Astra Micro Wave Products, Reliance Defence and Engineering and Walchandnagar Industries Ltd jumped between 5.5 per cent and 17.3 per cent.
Some recent outperformers fell, with Asian Paints down 1.23 per cent. The stock has gained 19.2 per cent since April-end as of Tuesday's close.
Kotak Mahindra Bank lost 1.47 per cent after rising 22.5 per cent since the end-February.
(With inputs from Reuters)