The benchmark indices BSE Sensex and NSE Nifty ended flat on Thursday after opening up marginally higher. The gains in pharmaceuticals and metal shares were offset by losses in banking and energy shares. Analysts said the cautious trading could be attributed to the long weekend ahead as markets will remain closed on Friday on account of Ganesh Chaturthi.

The Sensex closed 28.05 points higher at 31,596.06, while the Nifty was up 4.55 points at 9,857.05.

The top five gainers on the Sensex were Lupin, Sun Pharma, Dr Reddy’s, Infosys and Cipla, while Adani Ports, Bajaj Auto, Kotak Bank, HUL and Bharti Airtel were the major losers.