A bump in US exports helped shrink the country’s yawning trade deficit in July while imports from China continued to fall amid the two nations’ trade war, government data showed on Wednesday.

The relatively steady deficit comes as hopes dim for a near-term resolution to the Sino-US conflict, which has begun to rattle the US economy.

Economists on Wednesday said the trade gap is likely to widen in the coming months as demand for US manufacturing exports weakens further, creating a drag on the economy.

The US trade gap in July narrowed by 2.7 per cent to $54 billion, the largest drop in five months, as the US exported more automobiles, medications, aircraft and oil drilling equipment, the Department of Commerce said.

Economists had been expecting an even bigger decline.

Imports from China, the prime target of US President Donald Trump’s multi-pronged trade offensive launched last year, fell 1.9 per cent to $39 billion, their lowest level since April.

Mexico and the EU appear to have picked up some of the slack, as the US deficit with both markets continued to rise.

Overall, exports rose 0.6 per cent to $207.4 billion – which still left them below last year’s level through July. Imports fell 0.1 per cent to $261.4 billion.

Trump this week fired off stern warnings to Beijing and has planned successive waves of tariff increases through the end of the year covering the vast majority of Chinese imports into the US. Negotiations to resolve the conflict have yet to resume.

Weak commodities prices hit US exports for July, as the value of crude oil, coal, fuel oil and other petroleum products fell.

Meanwhile, US services imports, such as tourism and software royalties, hit a record $49.6 billion, eating into an area where the country normally enjoys a healthy surplus.