Canada and the US have reached a last-minute free trade deal to revamp the long-standing NAFTA pact between the two countries and Mexico.
The $1.2tn (£920bn) open-trade zone had been on the verge of collapse after 24 years – with Canada facing the prospect of being left out of a deal between the US and Mexico.
But with an overnight deadline approaching, negotiators reached a deal which the two countries said would "result in freer markets, fairer trade and robust economic growth in our region".
US President Donald Trump had threatened to walk away from NAFTA unless major changes were made – blaming the deal for the exodus of manufacturing jobs to Mexico.
But it was a deal with its northern neighbours that proved tougher to reach for the US.
Prime Minister Justin Trudeau said it was a "good day for Canada".
A senior Trump administration official said the new United States-Mexico-Canada Agreement (USMCA) as a "great win for the president and a validation for his strategy in the area of international trade".
A source told Reuters that Mr Trump had approved the deal.
US officials intend to sign the agreement at the end of November, after which it will be submitted to congress for approval, a US official said.
The deal will preserve a trade dispute mechanism that Canada fought hard to maintain, to protect its lumber industry and other sectors from US anti-dumping tariffs.
But it came at a cost, with Canada agreeing to provide US dairy farmers with access to about 3.5% of its $16bn annual domestic dairy market, according to Canadian sources – and Canadian farmers hurt by the deal set to receive compensation.
There was also an agreement to protect 2.6 million exports a year of Canadian vehicles to the US from possible US tariffs of 25% that Mr Trump may impose. That is more than the 2 million units currently exported.
More from Business
But the deal failed to resolve US tariffs on Canada's steel and aluminium exports.
Mexican foreign secretary Luis Videgaray said: "It's a good night for Mexico and for North America."