Indian stock markets snapped a four-month rally to end July in losses as simmering trade tensions with the US triggered a risk-off sentiment and caused a flight of foreign capital. Both the Nifty 50 and BSE Sensex shed 2.9% this month.

The Nifty settled 86.7 points or 0.35% lower at 24,768.35 on Thursday, when monthly futures contracts expired. The BSE Sensex lost 296.28 points or 0.36% to close at 81,185.58.

Of the 50 stocks on the blue-chip Nifty, 37 declined. The market capitalisation fell by nearly Rs 81,000 crore.

Foreign investors have pulled Rs 17,578 crore out of Indian equities in July, as per NSDL data.

Thursday saw high volatility for the large-cap indices with the Sensex swinging as much as 1,000 points between session’s high and low.

A day earlier, Trump announced a 25% minimum tariff on Indian exports as the two countries failed to reach a trade deal by the Aug. 1 deadline. That rate is far higher than Asian peers like Vietnam, Indonesia and South Korea.

Shares of Hindustan Unilever Ltd., ITC Ltd. and Eternal Ltd. were among the top gainers in the Nifty. On the other hand, Adani Enterprises Ltd. and Tata Steel Ltd. were among the top laggards.

In terms of point contribution, Reliance Industries Ltd. and HDFC Bank Ltd. weighed on the Nifty.

On the NSE, 12 of the 15 sectors ended in red, with Nifty Oil and Gas and Nifty Pharma falling the most. Nifty FMCG gained over 1.4% for the day, led by Godrej Consumer Products Ltd. and HUL.

The broader market fared poorer than the benchmark. The BSE MidCap fell 0.7% and SmallCap shed 0.85%.

The market breadth was skewed in favour of the sellers as 2,351 stocks declined, 1,557 advanced and 129 remained unchanged on the BSE.

. Read more on Markets by NDTV Profit.