The result could weigh on revised calculations of second quarter growth in the United States, which Trump hailed as a key achievement last week after it was reported as the strongest GDP increase in almost four years.
"Canadian trade was a large and pleasant surprise in June, and a surge in exports for the month capped a solid quarter", Canadian Imperial Bank of Commerce chief economist Avery Shenfeld wrote in a research note. The deficit had been expected to widen to $46.5 billion from the $43.1 billion originally reported for the previous month. "In real terms, exports rose 2.2% while imports fell 1.2% in June".
Overall exports dropped 0.7 percent to $213.8 billion, despite record overseas shipments of petroleum and all industrial supplies and materials. Exports rose sharply in prior months as the potential impacts from tariffs imposed by the Trump administration were front-run.
There were increases during the month of exports of crude oil, heavy fuel oils, diesel fuel, metal ores and non-metallic minerals, motor vehicles and parts, as well as industrial machinery, equipment and parts.
Canada's trade deficit fell to Can$626 million ($482 million US) in June, according to official data released Friday, as the nation searched for new trading partners and eased its reliance on the United States.
As a result, the trade surplus with the United States grew to C$4.12 billion in June from C$3.33 billion in May.More news: Bredesen, Blackburn win primaries in race for US Senate
More news: Omarosa claims Trump showed signs of 'mental decline' in book
More news: Corbyn tells Labour anti-Semites `you have no place in our movement´
The US bilateral trade deficits also expanded with China, the European Union, Canada and Mexico - all of which have retaliated against Trump's aggressive tariffs.
Economists also noted that the return of several Canadian refineries in June from shutdowns in April and May was a significant factor in both the export and import figures, as Canada had more energy products available for export and had less demand for energy imports to make up for the lost domestic production.
Additionally, the Trump administration has threatened to impose tariffs on automobiles shipped to the US market.
Total exports rose 9.2 per cent in June compared to the same month a year ago. Total imports were up 4.2 per cent compared with June 2017.
"But the first indications for the month suggest that there could be some growth left to come in the second quarter, upgrading the odds of a likely Bank of Canada rate hike in the coming months".
"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 Bank of Canada is counting on trade and investment to contribute more to an economic expansion as it raises interest rates, while saying protectionism remains the biggest risk.