Canada’s merchandise trade deficit with the rest of the world shrank dramatically in June to $626 million, the smallest in 17 months, while the U.S. trade deficit widened—including politically sensitive trade gaps with China, Mexico and Canada.

Statistics Canada says the improvement was due to a 4.1% increase in exports compared with May, to a record high $50.7 billion, mainly from higher exports of energy products and aircraft.

“Canada’s economy proved more than resilient in the face of newly minted U.S. tariffs,” said CIBC Capital Markets senior economist Royce Mendes in a Friday research note. “Despite affected industries taking a hit, a surge in other exports powered a narrowing of the deficit to levels not seen since beginning of last year.”

Energy exports—primarily oil—rose 7.1% to $9.9 billion, the highest since October 2014.

Read: What’s boosting the U.S. dollar—for now

Exports of transportation equipment and parts were up 18.9% to a record $2.5 billion, with exports of business jets accounting for much of the increase.

Canada’s largest trading partner, the United States, was the destination for a record $37.1 billion of exports, up 2.5%—mainly because of passenger cars and light trucks.

Meanwhile, imports from the United States were up 0.3% to $32.9 billion, resulting in Canada’s trade merchandise trade surplus with the U.S. rising to $4.1 billion.

Canada’s overall imports were down 0.2% in June to $51.3 billion.

Derek Holt, vice-president and head of capital markets economics at Scotiabank, wrote in a note that the figures show Canada is benefiting from stronger U.S. growth, while a rebound in cap-ex is driving exports.

“Data speaks louder than NAFTA negotiations,” he wrote. “The figures incrementally reinforce our expectations for a BoC rate hike on Sept. 5.”

CIBC Capital Markets chief economist Avery Shenfeld called the numbers “a large and pleasant surprise” in a research note Friday.

“The result looks to bump Q2 GDP tracking to above 3%, ahead of the Bank of Canada’s last projection by a few ticks,” he wrote.

The data adds “a bit of weight to the odds for a September hike, or at a minimum, gain[s] even more confidence about one in October.”

U.S. trade deficit grows to $46.3 billion

The U.S. trade deficit widened in June for the first time in four months as exports fell and imports grew.

The Commerce Department said Friday that the deficit in goods and services—the gap between what the U.S. sells and what it buys from other countries—rose 7.3% to $46.3 billion in June from $43.2 billion in May. U.S. exports slid 0.7% to $213.8 billion; imports rose 0.6% to $260.2 billion, led by increases in medicine and crude oil. (All figures are in U.S. dollars.)

The United States ran goods deficits in June of $33.5 billion with China, up 0.9% from May; $7.4 billion with Mexico, up 10.5%; and $2 billion with Canada, up 39.7%.

Read: What might cause trade tensions to ease

In the first half of the year, the United States has registered a trade deficit in goods and services of $291.2 billion, up 7.2% from January-June 2017.

President Donald Trump campaigned on a promise to bring down the gap, which he views as a sign of economic weakness resulting from bad trade deals and abusive behaviour by U.S. trading partners like China and Mexico.

In a flurry of activity this year, he has slapped taxes on imported steel and aluminum and on $34 billion in Chinese products. He has threatened to dramatically increase the tariffs on China and to begin taxing imported cars, trucks and auto parts. He also is attempting to renegotiate the North American Free Trade Agreement with Canada and Mexico.

But his efforts have so far failed to contain the deficit.

“The president promised a transformation of trade policy to bring down the deficit,” said Lori Wallach, director of the left-leaning Public Citizen’s Global Trade Watch. Trump, she said, “has not lived up to his promises.”

Mainstream economists blame persistent U.S. trade deficits on an economic reality that can’t be changed much by trade policy: Americans spend more than they produce, and imports fill the gap.

In June the United States posted a surplus of $22.5 billion in the trade of services such as banking and education. But that was offset by a $68.8-billion deficit in the trade of goods.