In see-saw trade, the 30-share Sensex surrendered hefty gains in last two hours to end 9.27 points, or 0.05 percent, up at 20,159.12. 19 Sensex stocks gained and 11 dropped. The Sensex had gained 299 points in past 3 days.

The broad-based National Stock Exchange index Nifty edged up by 2.60 points, or 0.04 percent to 6,031.80. Also, SX40 index, the flagship index of MCX-SX, closed 12.62 points up at 12,059.31.

The trend further weakened on over 12 percent drop in L&T April-June quarter profit at Rs 756.03 crore. However, a rebound in banking sector on value-buying and firm trend in global markets helped the market end in green, they added.

Energy major RIL ended seven-day rally by dropping 1.59 percent to Rs 908.50 and engineering major Larsen and Toubro fell 7.46 percent to Rs 901.95. BHEL plunged by 7.05 percent to Rs 161.50 as concerns over new orders remained.