Sensex fell early but later rose 108.95 points to 77,264.57; Nifty gained 44.25 points to 24,132.60.
Brent crude eased 1.66% to ₹78.23 a barrel, supporting market sentiment.
Infosys, TCS, Tech Mahindra and HCL Tech were among the laggards, while Trent, BEL, HDFC Bank and L&T gained.