Oil posted its biggest weekly loss since May as turmoil in equity trading spilled over into the crude market.

Futures dropped 4 percent this week in New York, echoing declines in the S&P 500 Index amid fresh concern about the escalating U.S.-China trade war. Oil stockpiles in the world’s biggest economy are swelling amid International Energy Agency warnings about growing threats to global energy demand.

“The long oil trade is way too overcrowded and these markets tend to overshoot their supply demand dynamics,” said Phil Streible, senior market strategist at RJ O’Brien Associates LLC. “We’re seeing liquidation in the oil market because of the spillover effect from the equity market.”

Pessimism enshrouded oil markets that as recently as last week ascended to a four-year high. A darkening demand outlook, coupled with stock market routs around the globe highlighted the fleeting investor appetite for risky assets.

“A correction seemed to be kind of coming and we finally witnessed it,” said Gene McGillian, senior analyst and broker at Tradition Energy.

West Texas Intermediate crude for November delivery advanced 37 cents to end the session at $71.34 a barrel on the New York Mercantile Exchange.

Brent for December settlement rose 17 cents to settle at $80.43 on the London-based ICE Futures Europe exchange. It traded at a $9.25 premium to WTI for the same month.