The US merchandise-trade deficit shrank in April by the most since 2009 as imports fell amid lockdowns in China while exports increased to a record.

The shortfall narrowed by 15.9% to $105.9 billion last month, following a record level in March, Commerce Department data showed Friday. The figures, which aren’t adjusted for inflation, compared with a median estimate for a gap of $114.9 billion in a Bloomberg survey of economists.

Aggressive lockdowns by the Chinese government to curb the spread of Covid-19 have complicated the near-term trade picture, with the measures—coupled with Russia’s war in Ukraine—straining already-tenuous global supply chains. While the volume of products arriving at the biggest US ports in April was near records, a worldwide acceleration in inflation is testing goods trade, with the World Trade Organization cutting its forecast for growth in global merchandise volumes this year. 

In the first quarter, the widening of the trade deficit largely explains the economy’s worst performance since the pandemic recovery began, with gross domestic product shrinking at a 1.5% annual pace. That’s because the value of products American businesses and consumers bought from overseas outpaced purchases of U.S. goods and services by other economies.

A separate report Friday showed US inflation-adjusted consumer spending rose in April by the most in three months. That, coupled with a shrinking trade deficit and higher inventories, suggests economic growth is off to a strong start for the second quarter.

US merchandise imports decreased 5% from the prior month to $279.9 billion, reflecting declines in industrial supplies, capital goods and consumer merchandise.

Exports rose 3.1% to a record $173.9 billion in April, driven by foods, capital goods and industrial supplies. 

The Commerce Department’s report also showed wholesale inventories rose 2.1% in April, while stockpiles at retailers climbed 0.7%.

More complete April trade figures that include the balance on services will be released on June 7.