The markets surged in late-noon trades as investors bought shares from select sectors.
A recovery in European markets also helped the Sensex to climb to a high of 16,754.
The BSE benchmark index finally ended up 242 points at 16,709.
The Nifty reclaimed the 5,000-mark and ended up 72 points at 5,013.
European bourses recovered after opening in the red. CAC was up 1.3% at 2,934.
In Asia, markets ended on a mixed note. Nikkei dropped 1% to 8,518. Seoul Composite and Taiwan Weighted shed 2-3% each.
However, Hang Seng and Shanghai Composite ended with gains.
Moody's Investors Service on Wednesday downgraded credit ratings on Credit Agricole SA and Societe Generale SA by one notch, citing their exposure to the Greek economy.
Meanwhile, finance ministers of the Brics countries will take a call on supporting the euro zone at a meeting in Washington later this month. Fears of a spiralling inflation continued to haunt sentiments.
Headline inflation inched closer to the double-digit mark in August, rising to 9.78% on the back of soaring prices of food and manufactured products, which may prompt the RBI to continue with its monetary tightening policy.
Overall inflation, as measured by the Wholesale Price Index, stood at 9.22% in July. The rate of price rise stood at 8.87% in August, 2010.
Keeping the inflation numbers in view, RBI is likely to increase key rates on Friday's credit policy review.
Markets are also likely to watch the corporate advance tax figures which is set to come out on Thursday.
"Headline inflation has accelerated to a high of 9.78% on the backdrop of weakened industrial output figures.
"This raises the question whether the RBI's monetary policy is at all having an effect or in reality curbing economic growth.
"Wehope that the RBI pauses in the current cycle and reflects on alternate means to address this issue.
"It is important to observe this as part of a larger picture and identify specific pressure points in the economy.
"The fear that inflation is becoming systemic now is quite real," said Anis Chakravarty, Director Deloitte Haskins & Sells.
In other news, the Rupee recovered to 47.78 against the dollar. It had fallen to its weakest level in nearly 2 years on Tuesday, as worries Europe could be heading for another banking crisis rattled global markets.
The IT index surged 4.5% to 5,084. BSE metal, banks and oil & gas stocks also rose smartly. Infosys gained 5.7% to Rs 2,353.
Wipro and TCS gained 2-4% each.
Among other gainers were Jaiprakash Associates, Jindal Steel. Hindustan Unilever, HDFC Bank and Hindalco. Reliance advanced 1.7% to Rs 825.
However, capital goods index remained weak and ended down 0.3% at 12,102. Tata Power, Larsen & Toubro, Cipla and Bharti Airtel shed 1-2% each.
Stocks of airline companies shed on reports that the oil marketing companies are planning to hike aviation turbine fuel prices by around Rs 1,250 a kilolitre (kl) from the current Rs 56,260 a kl in Delhi.
Jet Airways and SpiceJet shares dropped 1-3% each.
Retail stocks dipped lower as government deferred the approval for foreign direct investment in the retail sector.
A lack of political will is seen as the main reason for the government not taking up the proposal actively, even two months after the in-principle nod by the CoS.
Among individual stocks, Pantaloons Retail, Brandhouse Retail, Store One Retail and Trend slipped 1-8%.
BSE market breadth was positive. Out of 2,912 stocks traded, 1,527 advanced while 1,268 declined in trades.