However, telecom stocks tumbled up to 6.5 per cent after Reliance Jio decided to offer extra data on some plans, intensifying the tariff war in the sector.
Speculators covered their short positions ahead of the January derivatives expiry tomorrow, building up the momentum.
The 30-share Sensex rallied to an all-time high of 36,268.19 intra-day.
However, emergence of profit-booking at record levels ahead of January derivatives expiry sent it lower to 36,036.51. It finally settled 21.66 points, or 0.06 per cent, higher at 36,161.64 -- surpassing its previous record closing of 36,139.98 reached yesterday.
Meanwhile, foreign portfolio investors (FPIs) continued their buying activity. They bought shares worth a net Rs 1,229.35 crore, while domestic institutional investors (DIIs) made purchases to the tune of Rs 169.03 crore yesterday, provisional data showed.