WASHINGTON — The United States and Canada reached a last-minute deal to salvage the North American Free Trade Agreement on Sunday, overcoming deep divisions to keep the 25-year-old trilateral pact intact.
The deal came after a weekend of frantic talks to try and preserve a trade agreement that has stitched together the economies of Mexico, Canada and the United States but that was on the verge of collapsing. After more than a year of tense talks and strained relations between President Trump and Prime Minister Justin Trudeau of Canada, negotiators from both sides came to a resolution just ahead of a midnight deadline set by the White House.
The 11th-hour agreement was punctuated by a frenetic Sunday, with Canada’s leaders teleconferencing throughout the day with top American officials in Washington. Mr. Trudeau convened a 10 p.m. cabinet meeting in Ottawa to brief officials on the deal, as Jared Kushner, one of Mr. Trump’s closest advisers, and Robert E. Lighthizer, the president’s top trade negotiator, hashed out the final details. Mexico’s under secretary of foreign trade, Juan Carlos Baker, was expected to present the texts of the agreement to the Mexican senate just before midnight.
In a joint statement, Mr. Lighthizer and Canada’s foreign affairs minister, Chrystia Freeland, said the new deal “will give our workers, farmers, ranchers and businesses a high-standard trade agreement that will result in freer markets, fairer trade and robust economic growth in our region.”
The trilateral deal will no longer be called Nafta, they said, but will be named the “United States-Mexico-Canada Agreement.”
The deal represents a win for President Trump, who has derided Nafta for years and threatened to pull the United States from the pact if it was not rewritten in America’s favor. Overhauling trade deals has been one of Mr. Trump’s top priorities as president and he has used tariffs and other threats to try and force trading partners to rewrite agreements in America’s favor.
The Trump administration struck a deal with Mexico last month to rewrite Nafta and had threatened to jettison Canada from the pact if it did not agree to concessions like opening its dairy market to United States farmers. The White House had set a Sept. 30 deadline to release the text of its new trade agreement with Mexico.
As part of the deal, Canada will ease protections on its dairy market and provide access that is greater than what the United States would have gained through the Trans-Pacific Partnership, a trade treaty that Mr. Trump withdrew from last year.
The United States also relented on its demands to eliminate an independent tariff dispute settlement system that Canada has said is a red line in negotiations. Keeping that was a major concession for the United States and a change for what was agreed with Mexico.
The countries also reached an understanding that would protect Canada from the automobile tariffs that Mr. Trump has routinely threatened, though it is not clear how far those protections would extend. A senior administration official said that if those tariffs were imposed on global imports, Canada and Mexico would receive “accommodations” for their existing car production.
But in a sign of how fraught trade relations remain, Canada did not win assurances that Mr. Trump would lift the steel and aluminum tariffs he imposed earlier this year. Administration officials said that no changes had been made and that those levies are being addressed on a different track.
The agreement builds upon the deal that was reached with Mexico in August. That made updates to provisions surrounding the digital economy, agriculture and labor unions. Most importantly it made alterations to rules governing automobile manufacturing, in an effort to bring more car production back to the United States from Mexico.
“It’s a good day for Canada,” Mr. Trudeau said late Sunday, after convening a meeting with his cabinet. He said he would deliver more details about the agreement on Monday.
After months of sputtering talks, momentum picked up this weekend as Mr. Trudeau inserted himself and made clear that he wanted to get something done. Mexico has also scrambled to try and ensure that the Nafta pact remains trilateral.
President-elect Andrés Manuel López Obrador of Mexico said on Friday that Mr. Trudeau had appealed to him to help pave the way for a three-nation deal and that he would insist that a revised Nafta include Canada.
While Canada had played down the end-of-the-month deadline, the talks were restarted in earnest this weekend as the United States and Mexico signaled they would release text of their bilateral trade agreement as early as Friday. Mexico wants a deal signed before Dec. 1, when the new Mexican administration takes over, and the Trump administration wants the current, Republican-controlled Congress to vote on the deal quickly, given a potential change in control after the November midterm elections.
Lawmakers from both parties have urged the White House to include Canada in any revised Nafta, warning that excluding Canada, which is America’s largest export market, could disrupt supply chains, cost jobs and slow the United States economy. Companies and business groups, including the U.S. Chamber of Commerce, have repeatedly called on Mr. Trump to ensure Canada remains part of the pact, which has become critical for industries across North America, including automakers, agriculture and manufacturers.
Industry groups cheered the deal on Sunday night.
“Manufacturers are extremely encouraged that our call for a trilateral agreement between the United States, Canada and Mexico has been answered,” Jay Timmons, president of the National Association of Manufacturers.
Discussions between the United States and Canada had stalled amid souring relations between Mr. Trudeau and Mr. Trump, who lashed out at Canada last week during the United Nations General Assembly meeting for mistreating the United States on trade. The president said he had rejected a meeting with Mr. Trudeau because of Canada’s high tariffs, though Mr. Trudeau’s office said no meeting had ever been requested. Mr. Trump also threatened to tax Canada’s auto exports into the United States if it did not agree to America’s demands. That followed a testy meeting in June, when Mr. Trump accused Mr. Trudeau of being “dishonest.”
A revised Nafta that includes Canada has a far greater chance of being ratified by Congress but its fate is still somewhat uncertain. Democrats could take control of the House or the Senate in the midterm elections in November and attempt to call for changes to the agreement.
“The crucial test for a new Nafta, or any new trade agreement, is whether it is enforceable, particularly with respect to promises to protect worker rights and the environment,” said Senator Ron Wyden of Oregon, the top Democrat on the Senate Finance Committee. “Americans are sick of hearing speeches about the benefits of new trade agreements when the agreements in place aren’t even enforced and their opportunities don’t materialize.”
Lawmakers have said they do not expect Congress to vote on the deal until early next year.
Catherine Porter contributed reporting from Toronto and Katie Rogers from Washington.
A version of this article appears in print on , on Page A1 of the New York edition with the headline: A Last-Minute Deal With Canada Salvages a Trade Agreement. Order Reprints | Today’s Paper | Subscribe