The U.S.'s merchandise trade deficit with China narrowed in August as exports rose to a five-month high, a possible sign of goodwill from the Asian nation as the countries try to resolve their trade war.

The goods-trade gap with China shrank to a seasonally adjusted US$28.9 billion from US$29.6 billion a month earlier, according to data released Friday by the Commerce Department. Exports increased to US$10 billion while imports declined slightly to US$38.9 billion. The overall U.S. deficit in goods and services trade widened to US$54.9 billion in August, more than expected.

The bigger overall gap reflects a rise in imports, particularly consumer goods including mobile phones, which could result from President Donald Trump's Aug. 1 announcement of a 10 per cent tariff on a further US$300 billion in Chinese imports. Overall imports of consumer goods were a record US$57.2 billion in August.

The trade war with China, and the uncertainty that surrounds it, have disrupted companies' supply chains, increased input costs and delayed investments in hiring and investment. Companies, cognizant of looming price increases, tend to import more before announced tariffs take effect.

Even with the latest figures, imports and exports with China have declined significantly since the trade war began in 2018, making China the third-largest U.S. trading partner this year behind Mexico and Canada, after it was No. 1 in 2018. So far this year, the U.S. merchandise deficit with China has narrowed to a seasonally adjusted $238.4 billion from US$270.1 billion in the same eight months of 2018.

Since the end of August, the trade war has escalated substantially. Additional levies went into effect on Sept. 1, with others set to rise or take effect Oct. 15 and Dec. 15. Chinese officials are set to visit Washington for trade talks next week.

Overall exports increased 0.2 per cent to US$207.9 billion, including industrial supplies and foods. Imports rose 0.5 per cent to US$262.8 billion.

The trade gap in petroleum shrank to a record low of just US$321 million as exports rose and imports declined. Excluding petroleum, the goods trade deficit widened to US$72.7 billion.

Exports and imports of goods account for about three-fourths of America’s total trade; the U.S. typically runs a deficit in merchandise trade and a surplus in services.