China’s export engine, vital for keeping the country’s growth target of around 5% within reach, is now threatened by signs of sagging US demand, just as Beijing is also struggling to jolt its own consumer economy.

Sales abroad have been a rare bright spot for China’s $17tn economy over the past six months, helping it weather the strain from sluggish domestic spending and a prolonged property slump.

Still after three months of acceleration, export growth in dollar terms unexpectedly slowed to 7% in July from a year earlier, data showed on Wednesday. On a seasonally adjusted basis, monthly export growth to the US fell slightly, according to Pantheon Macroeconomics.

But a potential demand shock from the US could prove hard to contain since the country remains the single largest destination for Chinese exports by country, despite years of trade rancour and tariffs designed to protect domestic industries. There’s also a risk that a US slowdown could send shockwaves around the world, curbing global demand for Chinese goods.

A downshift in the US would upend priorities for China, which has seized on a resurgent American economy post-pandemic to let domestic consumption take a back seat and instead leaned hard on external demand.

Now, however, a more adverse outlook for trade that smothers exports may force Beijing to look inwards for catalysts to unlock future growth.

“For China policymakers, their bottom line is to defend their growth target,” said Larry Hu, head of China economics at Macquarie Group Ltd. “If China can no longer rely on export growth, they’re going to switch back to domestic demand.”

“China’s unexpected export slowdown in July suggests foreign trade — the recovery’s key prop last quarter — may lend less support to 3Q GDP. The result is particularly concerning given the weakening outlook for the US economy, highlighted by the recent jump in American unemployment,” says David Qu, Economist, Bloomberg Economics.

Evidence has meanwhile mounted that the world’s biggest economy is slowing, contributing to a global stock market selloff this week and prompting concern that the Federal Reserve might have kept interest rates too high for too long.

What happens next will depend in large part on how US consumers fare as the labour market slows and sentiment remains weak.

Worse may be yet to come. A weaker-than-expected payrolls report last week, rising unemployment and a deepening contraction in manufacturing all point to a shaky labour market.

The US now absorbs a smaller proportion of Chinese exports than it did at the start of Donald Trump’s presidency in 2017, with its 13% share surpassed last year by the 27-member European Union as a whole. But more sluggish spending by American buyers would ripple across the globe, dragging down demand for Chinese products ranging from consumer electronics to apparel and machinery.

“On the back of a slowing US economy, threats of additional tariffs, and ongoing technological decoupling, China’s export-driven growth strategy will be more difficult to achieve this year,” said Kelvin Lam, a senior economist at Pantheon Macroeconomics.

Goldman Sachs Group Inc economists now see a one-in-four chance of the US sliding into recession, raising the probability from 15%.

The fallout of a consumer pullback in the US could be especially painful for emerging markets, where China has been strengthening its foothold. Such spillovers would risk undermining the strategy promoted by President Xi Jinping’s government to diversify trade by shipping more products to countries from Vietnam to Saudi Arabia.

“When the US sneezes, emerging markets get a cold, if not pneumonia,” said Alicia Garcia Herrero, chief Asia-Pacific economist at Natixis SA. “And China, as we speak, is more and more dependent on markets in the emerging world.” About 40% of China’s exports go to emerging and developing economies, compared with 33% in 2017 prior to a trade war with the US, according to data from the International Monetary Fund analysed by Bloomberg.

Another source of risk is that China’s export share in the global manufacturing industry is on the rise and now exceeds 30%, according to Jing Sima, chief China investment strategist at BCA Research.

“This positions China as particularly vulnerable to a global manufacturing slowdown due to the interconnected nature of global trade,” she said.

What’s more, China’s large investments in manufacturing, alongside subdued domestic demand, are putting downward pressure on prices and resulting in overcapacity in some sectors.

Under these conditions, external demand is left to pick up the slack. China’s trade surplus soared to a record high in June, raising the risk of its partners stepping up efforts to shield their markets from Beijing. That figure narrowed in July.

Recognising the risks to external demand, officials in China have been highlighting the need to boost domestic consumption.