Market breadth was positive with 917 advances against 324 declines.
Sentiment was also upbeat across global markets with Asian shares advancing as tensions between the US and North Korea came off the boil, although the Federal Reserve's concerns about weak USA inflation weighed on the dollar.
The domestic stock indices reversed early gains and turned volatile in late morning trade on Thursday due to a sudden sell-off in auto and banking stocks.
The Sensex and Nifty rose for a third consecutive session on Thursday, with Infosys Ltd leading the gains after announcing a likely share buyback, while Asian markets rose as tensions between the United States and North Korea eased.
Meanwhile, Asian markets closed mixed after a rally in the dollar was halted on political turbulence stateside while investors digested the Wednesday release of the Federal Reserve's minutes. The BSE 30-share barometer recovered by 49.58 points, or 0.15 per cent, to 32,277.85. Shares of two-wheeler market leader, Hero MotoCorp surged 0.28 per cent to Rs 3,717.20 after the company yesterday reported a 3.5 per cent increase in its profit after tax at Rs 914.04 crore for the first quarter ended June. Tech Mahindra gained 1.06 per cent while HCL Tech rose 0.79 per cent. Infosys drove gains in the Nifty IT index, which climbed as much as 1.4 percent in its biggest intraday percentage gain in almost a month. Infosys gained more than 4 per cent on both the indices after the IT major's board said it will consider a proposal to buy back shares at its meeting that will be held on Saturday.