The US trade deficit narrowed to $40.6 billion in October on a strong rise in exports, the Commerce Department reported Wednesday.
The trade gap fell 5.4 percent from September's upwardly revised number of $43.0 billion.
Exports rose 1.8 percent from September to a record $192.7 billion in October.
Imports were up a modest 0.4 percent at $233.3 billion, their highest level since March 2012.
Imports of crude oil, which account for 10 percent of US imports, rose 0.8 percent to $23.9 billion in October.
The October reading was a hair higher than analyst expectations.
"The trade data suggest that external demand for US goods is improving, suggesting a somewhat stronger global economy, and still resilient US domestic demand," said Tu Packard of Moody's Analytics.
Year-over-year, the US trade deficit fell 4.9 percent in October.