The US trade deficit fell by 22.4% to $34.2bn (£22.3bn) in June, the smallest gap since October 2009.
The percentage contraction was also the largest since February 2009.
The three-month average of the trade deficit, which irons out monthly volatility, also fell to $39.5bn in the three months to June from $40.5bn in the previous period.
Meanwhile, May’s trade shortfall was revised to $44.1bn from the previously reported $45.0bn.
The smaller June deficit could lead the government to revise economic growth for the April-to-June quarter up from its initial estimated annual rate of 1.7%.
“All else being equal, this could mean a net upward revision worth about 0.8 percentage points and take second-quarter growth to 2.5%,” said Wells Fargo economist Tim Quinlan.
In June, imports of goods and services fell by 2.5% to $225.4bn, mainly because of large declines in petrol imports and of industrial supplies and materials.
Exports of goods and services increased 2.2% to a record $191.2bn.
Of those, exports to the 27-nation European Union rose by 1.5%, while exports to China increased by 4.5% in June.
Imports from China fell by 2.2%, bringing the trade deficit with China down to $26.6bn from $27.9bn in May.