Canadian exports surged to a record $47 billion in March, but the country still posted a $135 million trade deficit for the month as imports also rose.

Statistics Canada reported Thursday that exports rose 3.8 per cent in March, more than twice as much as the 1.7 per cent growth in imports.

Energy products and consumer goods were responsible for much of the increase in exports, the data agency said.

Only two export sectors shrank, BMO economist Benjamin Reitzes noted: raw metals and minerals (down 1.9 per cent) and autos (down 1.8 per cent).

Compared to the same month last year, exports are now almost 13 per cent higher than they were in 2016.

Most of the surge in exports is going to countries other than the United States, which is a sign that Canada's economy is diversifying. Exports to countries other than the U.S. rose 15.3 per cent in March to a record high $12.6 billion.

The biggest increases came from China, India and South Korea.

"This is a solid report overall," Reitzes said. "While trade continues to have trouble gaining consistent traction, the firm end to [the first quarter of 2017] provides a nice handoff for Q2."