The benchmark indices ticked higher for the fifth straight session on Wednesday, following gains in RIL as well as banking and IT stocks.
There was, however, a mixed trend overseas after US President Donald Trump dashed hopes of a pre-election stimulus package.
After opening on a weak footing, the Sensex gained ground to close up 304.38 points or 0.77 per cent at 39,878.95.
Similarly, the broader Nifty jumped 76.45 points or 0.66 per cent to close at 11,738.85.
The Sensex has now gained 1,905.73 points in five sessions, while the Nifty has advanced 516.45 points during the same time period.
Titan was the top gainer