The Nifty had earlier broken out of the 5,950 resistance raising hopes of a pre-Budget rally but profit taking in defensive stocks and lacklustre trade in most other sectors capped gains.
However, energy, realty and IT stocks outperformed. Oil and gas stocks closed 1.7 per cent higher on account of strong buying in Reliance Industries. RIL gained 3.1 per cent and was among the top Nifty gainers. On Tuesday, the company had announced an investment of more than $5 billion to boost declining gas output at KG-D6 basis, India's largest offshore gas field.
DLF, the country's largest developer, was the top Nifty gainer, rising 3.6 per cent. The stock has seen sustained gains after DLF vice chairman Rajiv Singh indicated that earnings would improve going further, while net debt would fall. CLSA recently upgraded the stock to "outperform" from "sell", and raised the target price to Rs 280.
Ambuja Cements, state-run BPCL and HCL Tech rose 2.5-3.5 per cent.
30 stocks ended down on the Nifty led by infra lender IDFC, which fell 2 per cent. Tata Steel, drug maker Cipla, Jindal Steel and Power, mobile carrier Bharti Airtel and Kotak Mahindra Bank were the other big losers on the Nifty, closing 1-2 per cent down.