The Sensex and Nifty ended lower for a fourth straight session on Thursday, as Tata Motors dragged indexes down after its results failed to meet expectations, while sentiment was also hurt by worries about simmering US-North Korea tensions.

The benchmark BSE index closed down by 266.51 points or 0.84 per cent at 31,531.33, its lowest close in over a month. The broader NSE index ended lower by 87.8 points or 0.89 per cent at 9,820.25, its lowest close in nearly a month.

Among BSE sectoral indices, realty index plunged 5.12 per cent, followed by healthcare 3.15 per cent, auto 2.79 per cent and power 2.78 per cent. On the other hand, IT index was up 0.63 per cent and TECk 0.13 per cent.

Top five Sensex losers were Tata Motors (-8.6%), Dr Reddy's (-4.77%), Sun Pharma (-3.08%), Adani Ports (-2.66%) and Cipla (-2.47%), while the major gainers were Infosys (+1.35%), Wipro (+0.44%), TCS (+0.37%), L&T (+0.3%) and M&M (+0.26%).

The Nifty Auto index fell as much as 2.2 percent, its biggest percentage loss in over two-and-a-half months. Tata Motors, Eicher Motors and Motherson Sumi Systems pulled the index down, which has risen about 20 percent this year as of Wednesday's close.

The automaker's shares fell 8.6 per cent and closed at their lowest since May 2016 after the company's 42 per cent rise in June-quarter profit, helped by a one-off gain related to changes to Jaguar Land Rover's pension plans, failed to please investors.

Financial stocks continued their decline, with the Nifty Bank index dipping 0.5 percent and the Nifty PSU bank index losing as much as 1.9 percent.

Nifty Pharma index snapped its six-day losing streak after Aurobindo Pharma's first-quarter performance and management commentary boosted sentiment. The drugmaker's shares rose as much as 5.9 per cent.

Global sentiment was largely weak with Asian stocks falling as investors fretted about the simmering tensions between the United States and North Korea.

comment COMMENT NOW