A cargo ship is guided into the Port of Oakland by a pair of tug boats.

The U.S. trade deficit widened more than expected in August thanks in part to a record level of imports of consumer goods and as a fresh round of tariffs loom against China and the European Union.

The imbalance stood at $54.9 billion at the end of the month, more than the $54.5 billion projected by economists surveyed by Dow Jones and up from $54 billion in July.

Imports rose to $262.8 billion against estimates of $261.4 billion, while exports increased to $207.9 billion, which also beat expectations of $207.4 billion.

Consumer goods imports hit $57.2 billion, a reflection of increased demand as a healthy shopping appetite helps keep the U.S. economy afloat amid fears of a slowdown.