The report said the trade deficit widened to $46.3 billion in June from a revised $43.2 billion in May. The deficit had been expected to widen to $46.5 billion from the $43.1 billion originally reported for the previous month.
Statistics Canada noted that, on an unadjusted basis, exports of steel products to the US that were subject to a 25 per cent tariff fell 36.8 per cent in June after unusual gains of 40 per cent from February to May.
On a volume basis, exports were up 2.1 per cent while imports were down 1.2 per cent.
The federal agency said imports from the United States edged up 0.3 per cent in June to $32.9 billion.
The June deficit of C$626 million ($482 million) - the lowest since the C$485 shortfall recorded in January 2017 - was far smaller than the C$2.30 billion predicted by analysts in a Reuters poll.
Canada's largest trading partner, the United States, was the destination for a record $37.1 billion of exports, up 2.5 per cent - mainly because of passenger cars and light trucks.
And bilateral U.S. deficits widened with China, the European Union, Canada and Mexico, all trading partners that have retaliated against President Donald Trump's multi-front global trade war.
As the numbers were released, Beijing warned it was ready to impose new tariffs on $60 billion in American products if Trump pressed ahead with plans to hit another $200 billion in Chinese goods with steep punitive duties.
Canada imported less refined petroleum energy products as several Canadian refineries were brought back online, reducing the demand for foreign motor gasoline and diesel fuel. Exports surged 6 per cent, the biggest quarter-to-quarter increase in a decade, outpacing an impressive 3.2-per-cent rise in imports.
June capped off a strong second quarter for Canadian trade.
As the Federal Reserve gradually tightens interest rates, the USA dollar also has risen steadily since April, making American exports more expensive to foreign buyers.
"After acting as a drag on the economy for the preceding three quarters, external trade appears to have provided a decent boost to GDP growth in the second quarter", said Stephen Brown, senior Canada economist for Capital Economics.
The trade surprise, when added to robust gross domestic product growth in May and June's six-year-high inflation number, adds to the likelihood that the Bank of Canada will increase interest rates this fall, economists agreed.