The numbers: The U.S. trade deficit in goods shrank by 16% in April and eased off a record high, but robust demand for imports such as oil and consumer electronics is likely to keep it at historically high levels in the months ahead.

An early or advanced look at the trade gap in goods showed that it fell to $105.9 billion from an all-time high of $125.9 billion in March, according to Census Bureau figures. Imports fell and exports rose.

Wall Street economists had forecast the trade deficit to drop to about $115 billion.

Last year, the U.S. posted the largest trade deficit ever. The goods deficit topped $1 trillion for the very first time.

An advanced estimate of wholesale inventories, meanwhile, showed a 2.1% increase in April. Retail inventories rose 0.7%, according to an early estimate.

Big picture: The record U.S. trade largely explains the 1.5% decline in the first quarter in gross domestic product, the official scorecard for the U.S. economy. Deficits subtract from GDP.

The trade gap won’t weigh down GDP in the second quarter quite as much. Economists predict the U.S. is likely to expand at an annual rate of 2% or so, helped by the increase in inventories. Higher inventories add to GDP.

Still, the trade deficit is all but certain to set another record high in 2022 barring a recession. Americans have been gobbling up imports while exports have rebounded more slowly from the pandemic.

Key details: U.S. imports fell 5% to $279.8 billion in April, reflecting lower oil prices and a decline in shipments of consumer goods such as cell phones. Lockdowns in China that delayed shipments of goods may have also contributed.

Oil prices have risen since April, however, and could worsen the trade gap in May.

Exports of American-made goods climbed 3.1% in April to $173.9 billion. The U.S. exported more food, grains, oil and autos.

The full trade report for April, which includes services such as tourism and travel, comes out next week.

Market reaction: The Dow Jones Industrial Average DJIA, +0.47% and S&P 500 SPX, +1.15% rose in Friday trades.