Overseas, Asian markets ended mixed as the crisis in Russian Federation and Syria and heightened tensions between the USA and North Korea hurt investor sentiment.
The gauge lost 469.25 points in the previous four sessions, largely in tandem with a weak trend overseas on continued geopolitical concerns.
The 50-share NSE Nifty stayed in the green throughout the session and hit a high of 9,143.90, before closing at 9,136.40, up 32.90 points or 0.36 percent.
Foreign investors net sold shares worth Rs 930.67 crore while domestic institutional investors bought shares worth 878.08 crore on Tuesday, provisional data showed.
"Though large-caps remained sluggish, mid and small-caps remained higher after a week-long consolidation attracted value buying".
Anand James, Chief Market Strategist, Geojit Financial Services, said: "The US and Australia's visa norms turned up the heat on IT companies, while higher possibilities of El Nino put sentiments under check".
The BSE Information Technology index fared worse than the broader market, declining 0.3% to its lowest levels since February.
Among Nifty stocks, Grasim Industries was the top gainer, up 6.03 per cent followed by Bank of Baroda, Indiabulls Housing Finance, Zee Entertainment, which gained between 2.2-3 per cent. Wipro too rose 0.36 per cent to Rs 500.
Net NPAs rose to 0.81 percent of net loans disbursed from 0.29 percent earlier.
Yes Bank yesterday reported a 30.2 percent rise in net profit at Rs 914.12 crore for the last quarter of 2016-17, even as its bad assets swelled. Hong Kong's Hang Seng rose 0.97 per cent, while Shanghai Composite Index inched up 0.04 per cent. Japan's Nikkei ended a shade lower.
The S&P 500 and Dow closed lower and the Nasdaq advanced on Wednesday as investors digested the latest round of earnings, while a drop in oil prices weighed on the energy sector.
The key indices, which opened the day's trade on a positive note, closed with losses for the fourth consecutive session.
Power Grid took the top rank, climbing 4.35 per cent. Adani Ports, NTPC, Asian Paints, Coal India and Maruti Suzuki rose by up to 1.24 per cent.