Short-covering of positions ahead of muhurat trading was the main reason for the upswing in the benchmark indices on Tuesday.
Reliance Industries, which has the heaviest weightage in the indices, led the rally.
The Nifty closed at 5191.6, up 93.25 points while the BSE closed at 17254.86, up 315.58 points over Monday's close.
However, the 25 basis points interest rate hike by the Reserve Bank of India and deregulation of interest rates on savings bank accounts saw bank stocks shed more than one per cent.
All indices except banking and media on the NSE and banking, consumer durables, small cap and IPO on the BSE were in the green.
FIIs bought Rs 444.76 crore worth of equity in the net while DIIs were net sellers of equity worth Rs 879.46 crore. Retail investors on the BSE were net sellers of equity worth Rs 25.62 crore.
The markets were less volatile than on Monday as the volatility index India VIX lost 11.54 per cent to close at 22.31.
Analysts said the deregulation of interest rates on savings accounts would put pressure on the profitability of banks in FY12. “A one per cent hike in interest rates would erode the profitability of the banking sector by 12.85 per cent,” said Mr Jagannadham Thunuguntla, Head of Research, SMC Global Securities.