At the onset the BSE barometer zoomed by over 280 points, taking comfort from fall in inflation and better-than-expected industrial output.
However, the index pared gained and fell by nearly 100 points as the government failed to pass GST bill during the Monsoon Session of Parliament, which concluded today.
A falling rupee, which breached the 65-mark for the first time since September 2013 also weighed.
Resuming higher at 27,635.25, Sensex hovered in a range of 27,791.10 and 27,496.29 before ending at 27,549.53, showing a marginal gain of 37.27 points or 0.14 per cent.
It had lost 785.87 points or 2.78 per cent in previous four days.
The NSE 50-share Nifty inched up by 6.40 points or 0.08 per cent to 8,355.85.
There were also news reports that a government-appointed committee suggested that there was no legal basis to the imposition of the minimum alternate tax (MAT) on foreign investors, which perked up mood.
Banking, healthcare, auto and PSU all notched up gains while metal, realty, consumer durables and capital goods fell on profit-booking.
Also helped was China's central bank's statement that there will not be a further currency slump as feared by many.
China had devalued its currency twice within two days, sending shockwaves and fuelling fears of a currency war.
Among non-BSE stocks, Nestle India surged 2.78 per cent after the Bombay High Court set aside orders of food regulators banning Maggi noodles.
European stocks were higher in early trade, buoyed by corporate earnings.
