The deficit narrowed to $41.5 billion in September, the Commerce Department said Thursday. That is 5.1 percent below the August deficit and the smallest imbalance since December 2010.
Exports climbed 3.1 percent to an all-time high of $187 billion. That followed two monthly declines and reflected stronger sales of commercial aircraft, heavy machinery and farm goods.
Imports rose 1.5 percent to $228.5 billion. An increase in consumer goods drove the gain, including shipments of the new Apple iPhone5. Higher oil prices also contributed to the gain.
The narrower trade deficit could lead the government to revise its July-September economic growth estimate slightly higher than the 2 percent annual rate reported last month. That's because U.S. companies earned more from overseas sales while consumers and businesses spent less on foreign products.
But economists cautioned that the increase in exports may only be temporary. One reason is soybean exports rose 32 percent in September from August, in part because of a jump in prices linked to the summer drought.
"More generally, export growth has slowed by more than import growth as the weak global backdrop has taken its toll," said Paul Dales, senior U.S. economist at Capital Economics. "So while these data may boost third-quarter ... growth by a couple of tenths of a percent, further ahead net exports may not add anything to growth."
Europe's debt crisis and slower global growth in emerging markets had weakened demand for U.S. goods overseas in the previous months. That subtracted from economic growth in the third quarter.
Exports to the 27-nation European Union were unchanged in September from August. Exports to Latin America grew 4.2 percent, although exports to Brazil declined. Brazil is South America's biggest economy.
So far this year, the U.S. deficit is running at an annual rate of $554 billion, slightly below last year's $559.9 billion imbalance.
The U.S. deficit with China increased to $29.1 billion in September. It is running 6.8 percent ahead of last year's record pace. America's deficit with China last year was the highest imbalance ever recorded with a single country.
The widening trade gap with China has heightened trade tensions between the two countries. Many have complained that China's trade practices are unfair. American manufacturers say China has kept the yuan undervalued against the U.S. dollar. A lower valued yuan makes Chinese goods cheaper for U.S. consumers and American products more expensive in China.
The Obama administration has lobbied China to move more quickly to allow the yuan to rise in value. But it has refused to cite China as a currency manipulator. That designation would require negotiations between the two nations and could lead to the United States filing a trade case against China before the World Trade Organization.