Brokers said the beginning of new settlement in the derivatives segment also helped the index to end the day in the positive terrain.
The Sensex, which had lost 306.23 points in the past two sessions, recovered 37.25 points, or 0.15 per cent, to end at 25,099.92 during the session, it had touched the day's high of 25,209.61 at the outset.
Shares of Ranbaxy Laboratories caught buyers' fancy and jumped 5.14 per cent to close at Rs 496 per scrip after the company announced the US regulatory approval for hypertension drug to be launched by one of its subsidiaries.
Gains in Sun Pharma, Cipla, Infosys, Tata Consultancy Services, Wipro, RIL, Dr Reddy, Bajaj Auto and ITC Ltd shares also helped the 30-share index gain and snap its two-session falling streak.
On similar lines, the NSE index Nifty rose by 15.60 points, or 0.21 per cent, to end at 7,508.80 after moving between 7,538.75 and 7,482.30.
The sentiment got further boost with the rise in the rupee which was last trading higher at 60.11 against the US dollar.
Brokers further said market sentiments turned better on broad-based buying by funds and retail investors after crude oil prices in the global markets eased and beginning of new settlement of July series in the derivatives segment.
Besides, a mixed trend on other Asian markets and higher opening of the European markets as investors awaited data on US consumer confidence buoyed the sentiments, they said.
In the 30-scrip Sensex, 12 stocks gained, while 18 constituents ended lower.
Meanwhile, foreign portfolio investors (FPIs) sold shares worth a net Rs 601.89 crore yesterday, as per provisional data from the stock exchanges.
Sectorally, the BSE Healthcare sector index gained the most by rising 2.48 per cent, followed by IT (2.45 per cent), Teck (1.78 per cent) and Realty (0.80 per cent).