The average price the US had to pay for imported crude oil saw its biggest monthly drop in three and a half years during June, as global demand fell.
US exports also increased, particularly to Europe and Japan.
The deficit was the smallest since December 2010.
Overall exports rose 0.9% to a record high of $185bn, with those of cars, drugs and industrial machinery increasing.
Exports of civilian aircraft, engines, and telecommunications equipment to Japan rose, as the country continues to recover from last year’s tsunami.
The US also sold more goods to the European Union despite the eurozone debt crisis. Exports increased 1.7% to the 27-member region.
Temporary uptick
Overall imports fell 1.5% to $228bn, the lowest in four months.
But the US trade deficit with China increased by 5.3% to $27.4bn as the US increased imports of Chinese products, primarily of computers, clothing, and mobile phones.
The rise in exports “suggests that the easing in global demand and the strengthening in the dollar have yet to take a major toll on the US,” said Paul Dales, an economist at Capital Economics.
“But we doubt this can last. Survey measures of export orders have already fallen sharply and it probably won’t be long before actual export growth slows,” he added.
The Commerce Department said last month that the economy grew at a 1.5% annual rate in the April-June quarter.