Canada recorded its first trade surplus in months in September as exports grew and imports shrank.

Statistics Canada reports merchandise exports grew 4.2%, while imports declined 0.3.

As a result, Canada’s trade balance with the world went to a surplus of $1.2 billion in September from a deficit of $487 million in August.

Exports rose to $39.7 billion, the highest value since October 2008, as six of seven sectors posted gains in September.

StatsCan says prices, which rose 3.9%, were the main factor behind the increase, while volumes edged up 0.3.

Imports fell to $38.5 billion, as volumes dropped 3.1% and prices increased 2.8.

The agency says the decline was driven by lower imports of machinery and equipment as well as automotive products, as both sectors suffered a decline in volumes.

Partly offsetting the decrease in imports were gains in two sectors — energy products, and industrial goods and materials. Prices rose in both sectors.

Exports to the United States increased five per cent to $28.2 billion, the highest value since January 2011. Imports from the United States decreased one per cent to $23.8 billion.

As a result, Canada’s trade surplus with the United States rose to $4.4 billion in September from $2.8 billion in August.

Exports to countries other than the United States rose 2.3 per cent to $11.5 billion, their fifth straight monthly increase. Imports from countries other than the United States rose 0.7 per cent to $14.7 billion.

Consequently, the trade deficit with countries other than the United States fell to $3.1 billion in September from $3.3 billion in August, the lowest level so far this year.