WASHINGTON—The U.S. trade deficit widened more than forecast in October to the highest in a decade, underscoring continued fallout from the trade dispute with China, Commerce Department data showed Thursday. The goods trade gap with China widened to a record.

The gap increased 1.7 percent to $55.5 billion, from a revised $54.6 billion in the prior month. Imports of all goods and services rose to a record, while exports were little changed. Overall exports came in at $211 billion after $211.4 billion the prior month. That included record shipments of petroleum, industrial materials and consumer goods.

Imports rose 0.2 percent to $266.5 billion from $265.9 billion, reflecting record purchases of autos and consumer goods. The overall merchandise-trade deficit was also the highest ever.

The report showed the unadjusted goods-trade gap with China, the world's second-biggest economy, widened to $43.1 billion in October from $40.2 billion.