Auto stocks, led by index heavyweight Tata Motors, which posted better-than-expected sales by its UK luxury car unit Jaguar Land Rover, spearheaded the rally.
Heavy buying in state-run oil & gas companies, on expectations of one-time diesel price hike to offset the rupee impact, alongside metal, financial and FMCG stocks, too, contributed to the upsurge.
Trading began on a positive note. However, the 50-share index surrendered early gains, reacting to a sharp spike in inflation - which shot up to 5.79 per cent in July from 4.86 per cent in June - and slipped into the negative zone.
Elsewhere, Asian markets ended mixed amid renewed worries over the Fed scaling back its stimulus measures following stronger than expected US retail sales data.
More From This Section
The Nifty hovered between a high of 5,754.55 and a low of 5,690.20 before finishing at 5,742.30, logging a smart gain of 43 points, or 0.75 per cent.
Tata Motors, Hindalco, BPCL, NMDC, DLF, ONGC, Cairn, GAIL, Tata Steel and ACC were the major Nifty gainers. Key losers included HCL Tech, Ranbaxy, BHEL, Dr Reddy's, Reliance Infra, Grasim, HDFC, Cipla, Bharti Airtel and Jindal Steel.