The U.S. merchandise-trade deficit widened to the second-biggest on record in June, reflecting a larger increase in imports that include costlier petroleum.

The deficit grew to $91.2 billion from $88.2 billion in May, according to Commerce Department data released Wednesday. The median estimate in a Bloomberg survey of economists had called for a $88 billion shortfall last month.

Imports climbed 1.5% to a record-high $236.7 billion, as the value of inward-bound shipments of industrial supplies such as petroleum surged. Oil futures rose 11% in June, a third straight month of increases, topping $74 a barrel.

Exports rose 0.3% to $145.5 billion.

Government stimulus and higher savings have seen Americans increase purchases, as evidenced by an increase in retail sales. Imports have also climbed as companies work to replenish inventories that were whittled down by 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.

The global semiconductor shortage has hobbled manufacturers’ production plans, forcing auto manufacturers including General Motors Co. and Ford Co. to cut vehicle output.

The value of vehicle imports fell for a third month, dropping 2.5% to $28.5 billion. Exports climbed 1.7% to $11.6 billion, edging up from the lowest level since mid-2020.

Wholesale inventories climbed 0.8%, while retail inventories increased 0.3%.

Overall, the value of U.S. exports plus imports climbed to $382.1 billion in June, a fresh record.

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