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.
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.
As the election nears, you will see more volatility in the markets. Profit-taking is expected at this level, but the undercurrent is firm.
NSE ended up 0.19 percent after earlier gaining as much as 1.1 percent to hit a record high of 6,574.95 points, surpassing its previous record high hit on March 11.
The Sensex added 0.1 percent after earlier rising as much as 1.1 percent to an all-time high of 22,040.72 points, above its previous record hit on March 10.
FII's 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.
Banks led gains on Tuesday, with Yes Bank Ltd rising 2.2 percent and State Bank of India advancing 2.9 percent.
Among other domestic-oriented shares like , power equipment maker Bharat Heavy Electricals gained 0.6 percent, while cigarette maker ITC rose 2.5 percent.
Shares of Maruti Suzuki Ltd surged as much as 9.8 percent 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 percent higher.
Shares in AstraZeneca Pharma ( gained 2.6 percent 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 percent after earlier gaining as much as 1.3 percent, though shares in India's biggest private sector lender are still up 15.4 percent 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 fell 0.8 percent, bringing its losses so far this month to 6.8 percent.