The Sensex ended 646 points or 1.72 per cent higher at 38,178 and the Nifty surged 1.68 per cent or 187 points to close at 11,313.

In the last six trading sessions, the Sensex and Nifty corrected nearly 4 per cent marking their worst losing streak since July.

All sector gauges barring the Nifty IT index ended higher led by the Nifty Bank index's 3.7 per cent gain.

Nifty Bank index surged 1,018 points to 28,840.

Nifty Financial Services, Nifty Metal, Nifty PSU Bank, Nifty Realty and Nifty Private Bank indexes also rose between 2.2-3.7 per cent each.

Mid- and small-cap shares also witnessed buying interest as the Nifty Middcap 100 index rose 1.3 per cent and Nifty Smallcap 100 index climbed 0.9 per cent.

"Markets are likely to scale new highs by Diwali," AK Prabhakar, head of research at IDBI Capital told NDTV over phone.

Analysts say the onset of the corporate earnings season and macroeconomic data will be monitored closely for near-term cues.

Corporate earnings season for Nifty companies will begin from Thursday with IndusInd Bank and IT giant Tata Consultancy Services reporting their second quarter numbers. Infosys will declare its results on Friday.