The 30-share gauge rallied over 400 points during the day to hit an all-time high of 39,115.57.
But, it surrendered most of its gains to settle at 38,871.87, showing a rise of 198.96 points, or 0.51 per cent.
The Sensex gains were led by metal, auto, energy and infra sector stocks amid positive global cues.
Similarly, the NSE Nifty settled the day at 11,655.60, rising 31.70 points, or 0.27 per cent, over its previous close. The broader index gave up crucial gains after breaching the key 11,700-mark.