The complete turnaround in Chinese stock market gave the sentiment a big lift.
The government is slated to release data on industrial production (IIP) for May later in the day.
The 30-share barometer resumed in the positive terrain, hitting the day's high of 27,729.46. But with profit-booking kicking in, the index slipped into the negative territory and plunged to a low of 27,530.90.
However, some late-afternoon buying towards the fag end of the session helped it stage a comeback to close 87.74 points, or 0.32 per cent, higher at 27,661.40.
On a weekly basis, the Sensex and the Nifty ended lower by 431.39 points (1.53 per cent) and 124.35 points (1.46 per cent), respectively, snapping three weeks of gains.
Sentiment turned for the better after Shanghai Composite jumped 4.54 per cent on the back of new government measures to tame market decline. There were hopes that Greece is inching towards a loan deal with its international creditors this Sunday to avert bankruptcy and a Grexit.
The broader 50-share Nifty also edged up 32 points, or 0.38 per cent, to 8,360.55 after shuttling between 8,377.10 and 8,315.40.
Among index heavyweights, Vedanta was the top gainer while others such as Sun Pharma, BHEL, HDFC Bank, RIL and L&T too ended in the green.
Out of 30 Sensex components, 16 advanced and 14 lost.
Sector-wise, banking stole the show, up 1.15 per cent, followed by healthcare, capital goods, metal and oil & gas.
Buying activity also helped BSE small-cap and mid-cap indices close with modest gains.
