Canada and the United States reached a deal on Sunday night for Canada to stay in a free trade pact with the US and Mexico.
In a joint statement, the US Trade Representative Robert Lighthizer and the Canadian Foreign Affairs Minister Chrystia Freeland said the agreement "will strengthen the middle-class, and create good, well-paying jobs and new opportunities for the nearly half-billion people who call North America home".
The new deal, reached just before a midnight deadline imposed by the US, will be called the United States-Mexico-Canada Agreement, or USMCA. It replaces the 24-year-old North American Free Trade Agreement (Nafta), which President Donald Trump had called a job-killing disaster.
The agreement reached on Sunday gives US farmers greater access to the Canadian dairy market. But it keeps a Nafta dispute-resolution process that the US wanted to jettison and offers Canada protection if Mr Trump goes ahead with plans to impose tariffs on cars, trucks and auto parts imported into the US.
"It's a good day for Canada," Prime Minister Justin Trudeau said as he left his office. He said he would have more to say later on Monday.
"We celebrate a trilateral deal. The door closes on trade fragmentation in the region," Jesus Seade, trade negotiator for Mexico's incoming president, said via Twitter.
Representatives for the government of Mexican president-elect Andres Manuel Lopez Obrador have called a press conference to discuss details of the trade deal on Monday.
Canada, the United States' No 2 trading partner, was left out when the US and Mexico reached an agreement last month to revamp Nafta.
The Trump administration officially notified Congress of the US-Mexico trade agreement on August 31. That started a 90-day window that would let outgoing Mexican President Enrique Pena Nieto sign the new pact before leaving office on December 1.
Mr Trump threatened to go ahead with a revamped Nafta — with or without Canada. It was unclear, however, whether he had authority from Congress to pursue this with just Mexico.
Some politicians expressed relief that Canada had been reinstated in the regional trading bloc.
"I am pleased that the Trump administration was able to strike a deal to modernise Nafta with both Mexico and Canada," said Senate Finance Chairman Orrin Hatch. "Nafta is a proven success."
Nafta tore down most trade barriers between the United States, Canada and Mexico, leading to a surge in trade between the three countries. But Mr Trump and other critics said it encouraged manufacturers to move south of the border to take advantage of low Mexican wages, costing American jobs.
Mr Trump campaigned on a promise to rewrite Nafta — or get rid of it. Talks on a rewrite began more than a year ago. To placate the US president, Mexico agreed in August to provisions that would require 40 per cent to 45 per cent of a car be built in countries where auto workers earned at least $16 an hour (Dh59) to qualify for Nafta's duty-free benefits.
US-Canada talks bogged down earlier this month, and most trade analysts expected the September 30 deadline to come and go without Canada being reinstated.
They suspected that Canada, which had said it wasn't bound by US deadlines, was delaying the talks until after the provincial elections on Monday in Quebec, where support for Canadian dairy tariffs runs high.