The index closed just shy of the 21,000 level amid strong capital inflows from foreign funds and as the rupee gained for the third straight day.
Shares of power generation and distribution companies rose on strong demand from investors during the follow-on public offer of state-run Power Grid Corporation of India.
PSU, consumer durables, capital goods, metal and banking sector shares also moved up.
The S&P BSE Sensex fell in early trade to the day's low of 20,922.45 before recovering to 21,049.84. The index ended at 20,996.53, showing a gain of 38.72 points or 0.18 per cent.
More From This Section
Exit polls after elections ended on December 4 showed gains for the BJP in Delhi, Chhattisgarh, Madhya Pradesh and Rajasthan. The results are due on Sunday.
The rupee advanced to 61.48 against the dollar in intra-day trade from yesterday's close of 61.75.
A report on US jobs data for November, due to be released later today, may help investors estimate when the Federal Reserve will start tapering its monthly bond purchases.
"In the immediate term, market movements will be determined more by the economic data in US and the outcome of the elections," said Dipen Shah, Head - Private Client Group Research at Kotak Securities. "Earlier-than-expected tapering of the monetary stimulus in US can impact markets negatively."
Foreign institutional investors bought shares worth a net Rs 1,151.51 crore yesterday, according to provisional data from the stock exchanges.
Key indices in China, Singapore, South Korea and Taiwan fell, while they rose in Hong Kong and Japan. In Europe, indices in France, Germany and UK inched up in early trade.