(Bloomberg) -- The U.S. merchandise-trade deficit widened more than forecast in May as the value of imports rose to near-record levels and exports declined.

The deficit increased to $88.1 billion from a revised $85.7 billion in April, according to Commerce Department data released Thursday. The median estimate in Bloomberg survey of economists had called for a $87.5 billion shortfall last month.

Imports rose 0.8% to $232.4 billion, while exports declined 0.3% to $144.3 billion. The value of inward-bound consumer-goods shipments climbed to $63.8 billion.

Imports have resumed gains as house-bound Americans purchase goods for their homes and retailers work to replenish inventories made lean following the initial pandemic-induced global stoppage. Ports worldwide have been congested and freight rates have climbed to records amid a shortage of pallets and containers.

Wholesale inventories climbed 1.1%, while retail inventories retreated for a third month, dropping 0.8%.

Overall, the value of U.S. exports plus imports climbed to $376.7 billion in May, signaling a continued rebound in trade as the world recovers from the pandemic.

Vehicle Effects

The biggest percentage-change decline in exports came from vehicle exports, which fell 4.7% to $11.4 billion, a second month of decreases.

The value of automotive-vehicle imports slipped 0.6% to $29.2 billion.

Automakers in April said they had deepened and extended production cuts at some North American plants as they cope with a worsening global shortage of semiconductors. Chip-starved industries from automakers to consumer electronics will need to wait a bit longer for components, as delays in filling orders continue to get worse.

The value of imports of industrial supplies climbed 4.5% from a month earlier to $51.9 billion, while exports dropped 0.9% to $51.8 billion.

The trade picture will come into greater focus when the final report, which includes services, is released on July 2.

(Updates with automotive-shipment data in seventh paragraph.)

©2021 Bloomberg L.P.