The NSE Nifty 50 index ended 1.03% higher at 13,466.30 and the benchmark S&P BSE Sensex rose 0.99% to 46,006.69.

Both indexes fell nearly 1% earlier in the day, swung between gains and losses, and surged over 1% in afternoon trade.

On Monday, the main indexes tumbled 3% and snapped six straight sessions of gains, with all nifty sub-indexes closing down between 6.9% and 1.7%, as India and other countries suspended travel from Britain on fears over the new virus strain.

On Tuesday, all the nifty sub-indexes finished up between 3.36% and 0.2%. The Nifty IT index advanced the most, closing up 3.36%.

Indian stocks have scaled record peaks in December boosted by record inflows from foreign institutional investors (FIIs) amid news of progress on COVID-19 vaccines, but analysts say a correction is likely as they remain over-valued.

"This is a bull market correction, it will be very fast and the recovery will also be quick and volatile," said AK Prabhakar, head of research at IDBI Capital in Mumbai.

"Among sectors, IT did not correct as much yesterday. IT companies stand to benefit the most from the pandemic as everything moves online, so we have not seen any correction there."

The Nifty Midcap 100 Index and the Nifty Smallcap 100 Index, which slid more than 3% earlier in the session, closed up 0.85% and 0.77%, respectively.

The Nifty Media index and the Nifty PSU Bank index which fell the most among sectoral indexes during the session, reversed course to close up 0.73% and 0.97%, respectively.

(Reporting by Chandini Monnappa in Bengaluru; Editing by Ramakrishnan M.)

By Chandini Monnappa