Higher shipments of passenger cars and light trucks south of the border helped drive up Canadian exports to the United States by 2.5 per cent in June to a record $37.1 billion, Statistics Canada reported Friday.

The federal agency said imports from the United States edged up 0.3 per cent in June to $32.9 billion.

As a result, Canada's trade surplus with the United States widened from $3.3 billion in May to $4.1 billion.

The record mark for exports to the United States comes at a time of friction in global trade. Canada, the United States and Mexico are engaged in protracted negotiations on a new North American Free Trade Agreement.

At the same time, trade spats have seen the United States and Canada impose tariffs on some products that cross the border. Additionally, the Trump administration has threatened to impose tariffs on automobiles shipped to the U.S. market.

In figures also released Friday, the U.S. Commerce Department said the country had a $2-billion US trade deficit with Canada, up 39.7 per cent from May.

Tariffs hit steel, aluminum shipments

June was the first month in which Canadian exports of steel and aluminum products to the United States were subject to tariffs.

Statistics Canada said exports of steel products to the United States that were subject to a 25 per cent tariff fell 36.8 per cent, following a 40 per cent gain from February to May.

Exports of Canadian aluminum to the United States that were subject to a 10 per cent tariff were down seven per cent in June, after a rise of 28.5 per cent from February to May.

"Thus far, the tariffs appear to be reducing Canadian exports to the U.S., and will likely serve to raise the cost of imported steel and aluminum for U.S. manufacturers with little relief in sight," TD senior economist Fotios Raptis said in a commentary.

Smallest gap since start of 2017

Statistics Canada said the country's overall merchandise trade deficit with the world narrowed from $2.7 billion in May to $626 million in June, the smallest deficit since January 2017.

Canada's total exports increased 4.1 per cent to $50.7 billion in June, the first time they have topped the $50-billion mark. The rise was mainly due to higher exports of energy products and aircraft.

Meanwhile, overall imports edged down 0.2 per cent to $51.3 billion in June.

The $626-million trade gap was much smaller than the consensus forecast of economists, who had been expecting a $2.3-billion deficit. The better-than-projected figure had some forecasters suggesting it could add pressure on Canada's central bank to hike interest rates.

"The figures incrementally reinforce our expectations for a [Bank of Canada] rate hike on September 5th," said Derek Holt, Scotiabank's head of capital market economics. "

"While they're always subject to revision, I'm frankly amazed that the trade deficit narrowed as much as it did after going to the most optimistic end of the range of consensus estimates," Holt wrote in a commentary.