The Sensex and the Nifty gained about 2 percent, led by gains in banking shares such as ICICI Bank, following a rally in Asian shares that rose after the European Central Bank boosted market sentiment by signaling its resolve to defend the euro zone.
ICICI Bank gained 4.1 percent ahead of earnings later in the day while HDFC Bank rose 3.15 percent.
The Sensex rose 1.78 percent to 16,935.60 points, a day after closing at its lowest level since June 6.
The Nifty advanced 1.9 percent at 5138.15 points.