The Sensex and the Nifty ended higher by nearly 1.7 per cent on Wednesday, propped by buoyant global markets.
Stocks also got a lift from the Union Cabinet meeting where the government approved several reforms, including allowing telecom companies to trade spectrum.
The 30-share BSE index Sensex surged 401.71 points or 1.59 per cent to 25,719.58 and the 50-share NSE index Nifty jumped 130.35 points or 1.7 per cent to 7,818.60.
Among BSE sectoral indices, metal index gained the most by 3.54 per cent, followed by auto 2.92 per cent, realty 2.76 per cent and power 2.31 per cent.
Financial stocks built on gains from the previous session, with ICICI Bank gaining 1.26 per cent, HDFC Bank up 1.19 per cent and Housing Development Finance Corp rising 0.99 per cent.
Metal stocks also surged with Hindalco rising 7.97 per cent and VEDL 6.85 per cent.
Telecommunications stocks such as Bharti Airtel rose 2.44 per cent and Idea Cellular gained 2.12 per cent after the Cabinet approved spectrum trading rules.
Global markets
Global shares surged on Wednesday, led by the biggest daily gains in Japan for seven years, helping lift the dollar and oil prices as the prospect of more stimulus from China soothed investors rattled by recent market turmoil.
The charge into stocks pushed yields on low-risk government bonds higher, with the rise exacerbated by the anticipation of auctions of German and US 10-year debt later in the day.
European shares rose, with the pan-European FTSEurofirst 300 index up more than 2 per cent in early trade.
Asian shares extended a global rally on Wednesday, with markets in China stabilising and Japanese stocks posting their biggest one-day gain since the height of the global financial crisis in 2008.
However, some analysts felt the rally has been fuelled by bargain-hunting as investors bought beaten down stocks.
“This is a short-lived rally, global macro economic environment is not going to change in a day,’’ Alex Mathews, head of research at Geojit BNP Paribas said.
“This rally will not sustain at higher levels, maybe 7,900 or 7,950 (on the NSE index) will be tested, tomorrow or day after we might see a selloff.’’
A report by SMC global said: "Asian shares surged early today, inspired by the positive finish in offshore markets and as investors bet on China to step on the stimulus pedal soon. US stocks ended sharply higher Tuesday with the main indexes posting their second-largest daily gains of the year. Consumer credit in the US increased by more than expected in the month of July, according to a report released by the Federal Reserve. The report said consumer credit climbed by $19.1 billion in July following an upwardly revised $27.0 billion jump in June. Economists had expected consumer credit to rise by $18.0 billion compared to the $20.7 billion increase originally reported for the previous month."
Brokers said widening of positions by participants, tracking extended gains in other Asian markets and overnight rally in the US on better-than-expected euro zone Q2 GDP data and hope for further market stimulus on Chinese markets, buoyed the trading sentiment here.
Asian markets caught a tailwind on Wednesday after upbeat German economic data powered gains in the U.S. and Europe, while the safe-haven yen skidded as investors' mood turned positive.
MSCI's broadest index of Asia-Pacific shares outside Japan was up 1.2 per cent in early trade, after major Wall Street indexes all logged gains of more than 2 per cent.