OTTAWA -- Higher oil prices helped shrink the country's merchandise trade deficit in January from its record high set at the end of last year as exports rose for the first time since July.

Statistics Canada said Wednesday the trade deficit amounted to $4.2 billion in January compared with a record deficit of $4.8 billion for December, which was revised from its initial reading of $4.6 billion.

Economists had expected a deficit of $3.5 billion for January, according to Thomson Reuters Eikon.

Josh Nye, a senior economist at Royal Bank, said the trade report provided a bit of encouragement.

"It's a good reminder that the energy sector's near-term difficulties, which weighed on growth toward the end of last year, should be largely transitory," Nye wrote in a brief report.

"Prices have rebounded this year and output should follow as mandatory curtailments are reduced."

However, Nye cautioned issues remain.

"Canadian exporters are swimming against the tide of a softening global industrial sector, slower global trade growth, and a US manufacturing sector whose growth appears to have peaked last year," he said.

Statistics Canada said total exports rose 2.9 per cent to $47.6 billion in January, the first increase since July 2018.

After five months of declines, exports of energy products rose 14.0 per cent in January to $7.1 billion boosted by a 36.5 per cent increase in crude oil exports on the strength of higher prices.

Excluding energy products, exports rose 1.2 per cent in January.

Meanwhile, total imports rose 1.5 per cent to a record $51.8 billion in January, boosted by imports of aircraft and other transportation equipment and parts.

Imports of aircraft and other transportation equipment and parts rose 52.6 per cent to a record $2.7 billion due to higher imports of airliners from the United States.

Regionally, Canada's trade deficit with countries other than the United States narrowed to $5.8 billion in January compared with a deficit of $6.6 billion in December as exports rose 7.9 per cent and imports climbed 1.1 per cent.

Canada's trade surplus with the United States fell to $1.6 billion in January compared with $1.8 billion in December as exports to the U.S. rose 1.1 and imports from the Canada's largest trading partner rose 1.8 per cent.