Canada's merchandise trade balance recorded its first monthly trade deficit since July, due to a combination of higher imports of pharmaceutical products and the appreciation of the Canadian dollar.

The country posted a $312 million trade deficit in December, from a surplus of $1.1 billion a month earlier, Statistics Canada reported Wednesday in Ottawa.

Economists had been expecting exports to exceed imports by $1 billion in December.

The drop in exports that month was partly due to the increase in the average value of the Canadian dollar by 1.5 U.S. cents compared with November — when the loonie appreciates against the greenback, monthly trade values expressed in Canadian dollars are lower.

A large proportion of import and export transactions are done in U.S. dollars and must be converted to Canadian dollars to compile monthly statistics, the agency said. Total exports were down 1.9 per cent in December and imports increased 0.2 per cent. But when expressed in U.S. dollars, Canadian exports edged up 0.1 per cent, and imports rose 2.3 per cent.

Imports of consumer goods jumped 9.4 per cent, the strongest monthly increase on record for this product category. Imports of pharmaceutical products, which surged 28.1 per cent, contributed most to the increase, driven by “atypical high-value imports” from the U.S., the agency said. Clothing and alcoholic beverages also posted notable increases.

In volume terms, exports fell 0.4 per cent, while imports rose 1.3 per cent.