In choppy trade, the Bombay Stock Exchange benchmark Sensex on Wednesday ended nearly 167 points higher on buying support which emerged after a strong opening in European bourses.
The 30-share index settled at 17,700.90 points, a rise of 166.81 points, or 0.95 per cent, from the previous close.
The index for a brief period dipped into negative terrain in opening trade, falling as much as 160.31 points.
The National Stock Exchange index Nifty closed 56.35 points, or 1.07 per cent higher, at 5,312.50 points. It moved in a range of 5,210.00 to 5,315.55 during the session.
Brokers said trading sentiment turned bullish following the firm opening in European markets and a partial recovery on Asian bourses.
Covering-up of short positions by investors also had a positive impact, they added.
Oil and gas sector stocks continued their winning streak in the wake of the government's decision to hike fuel prices last week.
The oil and gas sector indice surged 1.62 per cent to 10,874.13 after Reliance Industries rose by 1.84 per cent to Rs 1,086.90, ONGC by 1.11 per cent to Rs 1,320.40, Hindustan Petroleum by 7.94 per cent to Rs 469.70, Indian Oil Corp by 2.34 per cent to Rs 402.60 and Bharat Petroleum by 4.29 per cent to Rs 662.60.
Other sectoral indices such as the BSE FMCG rose by 1.90 per cent to 3,230.23, the BSE Auto index by 1.07 per cent to 8,323.30, the realty index by 0.93 per cent to 3,196.82, the power index by 0.78 per cent to 3,150.10 and the banking index by 0.76 per cent to 10,765.03.
In the 30-BSE index components, 25 stocks closed in the positive zone while 5 ended with losses.