The S&P BSE Sensex ended 37 points lower on Wednesday despite a strong opening, as investors continued to offload shares ahead of counting for the Bihar assembly elections on 8 November.

The Sensex closed at 26,552 points, down 0.14%, while the 50-share Nifty fell 20 points, or 0.25%, to end at 8,040.

The five-phase Bihar elections end on 5 November. 

"After showing some signs of recovery in the previous trading session and snapping a six- day losing streak, it seemed like indices were all set to move higher today. However, after opening with a solid gap up in early trades, benchmarks were unable to hold on to their gains led by selling pressure in pharma, IT, small-caps and banking stocks," said Amar Ambani, Head of Research, IIFL.

The BSE Sensex opened at 26,704, touched an intra-day high of 26,800 before ending in red; a rally in global markets failed to boost the sentiment.

Markets were also not buoyed by the release of a positive economic data, which showed that the services sector activity in the country rose to eight-month high in October.

Among the BSE sectoral indices, Power and Metal were the top losers, while Healthcare and IT ended as the biggest losers.

Tata Motors shares ended a little over 6% higher at Rs 405 after its subsidiary Jaguar Land Rover (JLR) reported better-than-expected sales in the US for October.

Stock prices of property developer DLF closed 1.6% higher at Rs 122 on the BSE after the Supreme Court rejected a plea filed by the market regulator to stall DLF from selling its stake in its rental businesses.

The company reported a 21% increase in its profit to Rs 131.5 for the second quarter in the current fiscal. 

Share prices of Maggi noodle maker Nestle India ended marginally higher at Rs 6,247 on expectations that its instant noodles will soon return to shelves. The company said that it had cleared the tests conducted on Maggi samples at the three NABL accredited laboratories, Business Standard reported.

Tech Mahindra shares fell 2.5% to end at Rs 543 despite the company's earnings for the September quarter surpassing Street expectations.

"The Net Profit came in at INR 786cr V/s INR 725cr expected and INR 676cr in 1QFY2016, a QoQ growth of 16.2%. During the quarter, the company added 18 clients, with one client added in US$50mn+, 2 in US$10mn+. We currently have BUY rating on the stock with a price target of INR 646," said Sarabjit Kour Nangra, VP Research - IT, Angel Broking.

On the commodities front, gold prices plunged by Rs 270 to close at Rs 26,430 per 10 gram, tracking weakness in the metal's prices overseas. Silver prices fell Rs 180 to Rs 36,070 per kg.