The markets took time to digest the gains of the last two days. After rallying more than 200 points on the previous day and bouncing back by a similar margin from the lows on Tuesday, the Sensex traded in a range of around 100 points throughout the day before ending at 18238, higher by 32 points and the Nifty ended at 5486, up 14 points.
Continuing their outperformance, the midcap index ended at 7783, up 127 points and the smallcap index ended at 9820, up 107 points.
On the global front, Wall Street had posted its best day in eight weeks overnight as investor mood brightened after better-than-expected factory data from the US and China. The Dow rose 254 points to 10,269 and Nasdaq gained 63 points to 2,177.
Mirroring gains in the US, the Asian markets too had a good day; the Hang Seng, Nikkei and Shanghai jumped more than a per cent each.
But the European markets were cautious ahead of the European Central Bank's interest rate decision and pending home sales in the US.
And trading in the US index futures indicated that the Dow could fall about half a percent at opening bell.
Meanwhile, the government revised the demand component of its April-June GDP growth data, while keeping the headline number unchanged at 8.8%.
The Central Statistical Organisation nearly tripled the initially estimated growth on the demand side from 3.7% to 10% following a rise in private consumption, government expenses and investments.
Jaiprakash Associates rose 4.3% to top the gainers list on the BSE after reporting a 51% surge in cement sales to 1.08 mt in August on a y-o-y basis.
Metal shares continued the good showing of the previous day following the gains in the LMEX, a gauge of six metals traded on London Metal Exchange. Sterlite strengthened by 2.5% at Rs 160 and Tata Steel added 1% at Rs 543.
Auto stocks strengthened, albeit selectively, on upbeat sales in August. The country's largest truck maker by sales Tata Motors rose 0.8%, gaining for the fourth straight day, as its total sales rose 32% at 65,938 units in August over the corresponding period last year.
And giving it comapny was Maruti, which was up 0.2% at Rs 1276. Hero Honda and M&M bucked the trend, though. And index heavyweight Reliance Industries ended flat, with a positive bias, at Rs 937.
Hero Honda ended as the top loser on the Sensex at Rs 1699, down 3.3%. TCS ended at Rs 843, lower by 1.5%, and BHEL ended at Rs 2397, down 1%. RCom saw some profit-booking after racing ahead by nearly 5% on the previous day.
The telecom major ended at Rs 162, lower by 0.6%, on the BSE. And public sector undertakings (PSUs) took a pause after running ahead in the previous session on renewed hopes of disinvestment proceedings. Hindustan Copper, STC, MMTC and NMDC lost between 1% and 4% each.
The market breadth was positive. Out of 3055 stocks traded on the BSE, there were 1847 advancing stocks as against 1080 declines.