In alternate bouts of buying and selling ahead of the expiry of derivatives contract on March 28, the Bombay Stock Exchange 30-share barometer moved in a narrow range of 18,758.88 and 18,612.37 before settling at 18,704.53, registering a rise of 23.11 points or 0.12 per cent.
In the past seven sessions, the index had plunged by 889.02 points or 4.54 per cent.
Buying in influential stocks like HDFC, HDFC Bank, ICICI Bank, ITC, HUL, Bharti Airtel, Tata Motors and TCS helped the 30-share Sensex end in positive zone at closing today.
Consumer durables and FMCG stocks, seen as defensive sectors, saw buying while oil&gas and realty faced pressure.
Energy giant Reliance Industries (RIL) was the top loser from the Sensex pack with a fall of 3.25 per cent. L&T, Tata Steel, GAIL India and Hero MotoCorp also closed down.
The NSE 50-issue CNX Nifty also broke its 7-day downtrend and edged up by 7.75 points, or 0.14 per cent, at 5,641.60.
"Market ended with marginal gains amid choppy session on Tuesday as market participants preferred to remain on the side lines ahead of the F&O expiry on Thursday. Breadth of market favouring declines remain an immediate concern but as long as Nifty adheres to 200 DMA placed at 5,624, some bounce back is not ruled out," said Amar Ambani, Head of Research, IIFL.
Some winding up of positions on ending of the current financial year also played a role today, brokers said.
Globally, Asian stocks ended mixed as key benchmark indices in Singapore, Hong Kong and South Korea closed up while those from Japan and China declined. Taiwan ended flat.
European markets were trading higher in their early trade as indices in France, Germany and UK rose in 0.05-0.74 per cent range.
The BSE and the NSE will remain closed on March 27 on account of "Holi".
In 30-share Sensex, 15 scrips firmed up while 14 declined. Hindalco Industries ruled steady.
Major gainers among Sensex constituents were Bharti Airtel (2.98 pc), HDFC (2.17 pc), HUL (2.15 pc), Tata Motors (1.72 pc), ITC (1.34 pc), CIL (1.24 pc) and Wipro (1.08 pc).
Among losers, Gail India dropped by 3.20 per cent, followed by Tata Steel (2.72 pc), Hero MotoCorp (2.69 pc), L&T (2.24 pc), BHEL (1.76 pc) and Tata Power (0.99 pc).
Sectorally, the S&P BSE-CD firmed up by 1.59 per cent, followed by S&P BSE-FMCG (1.13 pc) and S&P BSE-Teck (0.66 pc) while S&P BSE-Oil&Gas dipped by 2.06 per cent, followed by S&P BSE-Realty (1.95 pc), S&P BSE-CG (1.85 pc) and S&P BSE-Power (1.05 pc).
Commenting on NSE Nifty outlook, brokerage GEPL Capital said: "Nifty remained highly volatile throughout the day and concluded the session with a marginal gain of 7 points at 5641. Till the time it trades below the level of 5710 the bearish trend would remain intact. On the downside the level of 5600 and below that 5550 is a possibility."
Meanwhile, the total market breadth today continued its negative trend as 1,459 counters finished with losses while 1,290 closed with gains. Market turnover declined further to Rs 2,144.58 crore from Rs 2,189.84 crore last Friday.
Foreign Institutional Investors (FIIs) bought shares worth a net Rs 717.89 crore yesterday, as per provisional data from the stock exchanges.