After a shaky start followed by choppy trade, Indian markets rallied over 1.3 per cent at the closing session on Tuesday on value-buying in blue-chip stocks at the prevailing levels amid firm European cues.
Late-hour buying by funds and retail investors in stocks that had recently posted losess and a higher opening in the European markets reversed the early trend.
Besides, a strong recovery in rupee, which rebounded from a six-week low of 60.51 to 59.95 against the dollar in late afternoon trade, also helped the domestic sentiment to improve.
The 30-share BSE index Sensex ended at 25,521.19, up 330.71 points and the 50-share NSE index Nifty ended at 7,631.70, up 98.15 points.
Among BSE sectoral indices, oil & gas index was up 2.86 per cent, followed by banking 2.28 per cent, capital goods 1.93 per cent and power 1.88 per cent. Only FMCG index was down 0.17 per cent.
ONGC, Axis Bank, SBI, Coal India and BHEL were the top five Sensex gainers, while the top five losers were M&M, Hero MotoCorp, Dr Reddy's, HUL and Bajaj Auto.
The Sensex opened lower by 51.25 points at 25,139.23 and the Nifty fell 4.95 points or 0.07 per cent to 7,528.60 in early trade.
European stocks rebounded as investors awaited data that may show German investor confidence rose for the first time this year.
Asian shares swung between gains and losses as escalating tensions in Iraq and a gas dispute between Ukraine and Russia sapped investors' appetite for risk.
Militants from the Islamic State of Iraq and the Levant had seized a large swathe of northern Iraq and threatened to capture a key oil refinery. This forced Washington to not only consider options for military action but also hold brief talks with Iran to support the besieged government in Baghdad.
Ukraine crisis showed no signs of abating as Russia cut off gas to the country on Monday in a dispute over unpaid bills that could disrupt supplies to the rest of Europe and set back hopes for peace between the former Soviet neighbours.
Investors also await the Federal Reserve meet this week for getting clues on when the central bank might begin raising interest rates. The Fed's two-day policy meeting begins later in the day with a statement expected on Wednesday.