In choppy trade, the BSE benchmark index traded in a 130-point range before closing at 16,906.58, up 24.42 points.
On similar lines, the 50-share National Stock Exchange index Nifty advanced 6.15 points, 0.12 per cent to 5,120.80. It moved between 5,134.55 and 5,095.50 during the session.
Brokers said the refinery stocks attracted investor interest as the fall in crude oil prices might help ease the burden of selling fuels at subidised rates.
Sensex heavyweight Reliance Industries rose 1.05 per cent, Oil India gained 1.50 per cent and HPCL jumped 2.36 per cent.
In London, Brent crude for August delivery was trading at USD 91.43 per barrel on the ICE Futures exchange.
Out of the 30-share Sensex, 20 counters including Gail, Tata Power, ONGC and TCS gained while 10 counters including Hindustan Unilever, Sterlite Industries and ITC declined.
More From This Section
Ahead of expiry of this month's derivative contracts on Thursday, sentiment in Indian stocks was cautious amid subdued sentiment over recent RBI measures to prop up the rupee.
"Markets opened on a neutral note on mixed global cues. It was a choppy session for the markets ahead of the derivative expiry on Thursday," said Shanu Goel, Senior Research Analyst, Bonanza Portfolio.
The BSE Oil&Gas sector index led the sectoral indices by gaining 1.20 per cent on expectations that refiners might benefit from falling crude prices.
Globally, the trends in Asian markets were negative while European indices were trading mixed in early trade.