A surge in exports coupled with a drop in imports pushed Canada's trade deficit with the rest of the world lower in October, down to $169 million from more than $1 billion the previous month.

Statistics Canada reported Tuesday that Canada imported $38.3 billion worth of goods and services during the month. That's a 5.7 per cent decline from June's level, which was an all-time high.

That was almost offset by $38.1 billion worth of exports. Farm, fishing and intermediate food products led the gains in exports while metal ores and non-metallic minerals recorded the largest decline, the agency said.

Energy exports increased three per cent to $8.4 billion, the third consecutive monthly increase.

Regionally, Canada's trade surplus with the United States shrank from $3.2 billion in September to $2.8 billion in October. The trade deficit with the rest of the world shrank from $4.2 billion to $2.9 billion.