The market retreated and gave up some early gains, amid a batch of mixed results, but ended the day in positive territory on Friday.
The Sensex, which rose to 20,126.55, ended at 20,015.82 (provisional) with a gain of 51.79 points or 0.26%.
The Nifty closed at 6057.95, up 18.75 points or 0.31%.
Oil stocks flared up following the government deregulating diesel prices.
Power and PSU stocks too mostly ended notably higher.
Capital goods, FMCG and realty stocks found modest support.
Bank stocks mostly ended flat.
Metal, automobile, healthcare, consumer durables and information technology stocks traded weak.
Midcap and smallcap stocks mostly ended on a subdued note.