The Trump administration said Monday it had reached a new, 16-year trade deal with Mexico, setting in motion a rapid chain of events that could redraw the world’s largest trade agreement.

The ultimate scope of the deal could hinge on whether Canadian prime minister Justin Trudeau decides to join the agreement after months of feuding with President Trump.

White House officials said the agreement, centered largely on manufacturing, would help American workers by making it harder for countries like China to ship cheap products through Mexico and then into the United States. Harmonizing labor and environmental rules would also protect U.S. jobs and salaries, the officials said, by making it less attractive for U.S. companies to move operations to Mexico.

A senior administration official acknowledged that it was possible the changes could make certain products, such as automobiles, more expensive for American buyers because the costs that go into production were expected to increase.

A number of key factors remain unresolved in Trump’s effort to replace the North American Free Trade Agreement -- with Canada’s role the biggest among them. Trump and Mexican leaders also failed to resolve whether the U.S. tariffs on metals imports will remain in place.

The next phase of negotiations will pose a major test for Trump’s unique style of diplomacy, which has shown flashes of both creativity and impulsiveness throughout the process.

“It’s a big day for trade. It’s a big day for our country,” Trump told reporters he gathered in the Oval Office where they watched him speak at length by phone with Mexican President Enrique Peña Nieto.

Trump has long told top advisers that once he was able to cut a single trade deal with another country, it would lead to a flurry of agreements. That’s because it would prove to other world leaders that he’s serious about cutting deals, and some aides are hopeful that the Mexico agreement could serve as a template for other talks. But Trump also has a tendency to tout deals before they are complete, and a rebuke from either the U.S. Congress or Canada could scuttle the talks before they are finalized.

Top White House officials appeared split on whether they would proceed at all if Canada didn’t sign on to the deal. Trump left open the possibility of cutting Canada out of the final deal, which he said would replace NAFTA. But U.S. Trade Representative Robert E. Lighthizer told reporters later that every effort would be made to include Canada, even if it took weeks or longer for them to sign on to changes. And Mexican leaders also said Canada must be included in the deal.

There were also signs of division about what the agreement means for NAFTA. Trump said that the new deal with Mexico would lead to the termination of NAFTA and that he would rename it the United States — Mexico trade agreement. Lighthizer cautioned that no decision had been made about this.

Lighthizer said the White House planned to send Congress a letter by Friday that formally starts a 90-day process for changing NAFTA. He said it was still unclear what precisely the letter might say. It could say the U.S. has reached a deal with Mexico, he said, or it could say that an agreement has been reached with Mexico in the hopes that Canada would be brought into the package at a later date.

“We are in a position where we would like to send our letter to Congress by the end of the week,” Lighthizer said.

The agreement announced Monday will run for an initial 16 years, with an option to revisit issues in six years, and extend for another 16 years.

It would increase the percentage of each car — to 75 percent from the current 62.5 percent — that must be made in the United States or Mexico to qualify for duty-free treatment.

The two sides agreed to a provision that would require a significant portion of each vehicle to be made by workers making at least $16 per hour -- a significant increase for Mexico.

The White House and Mexican officials were unable to reach an agreement about the steel and aluminum tariffs Trump imposed several months ago, and those discussions are ongoing. “That’s the issue we still have to deal with. It’s not dealt with," Lighthizer said.

And there were fundamental questions marks about the role of Canada and the future of a regional trade agreement. Peña Nieto, speaking with the president on speaker phone, mentioned several times that he wanted Canada to be involved.

Marcelo Ebrard, who has been chosen as Foreign Minister in the new Mexican administration, also said in a statement that while the agreement was a “positive step” Canada was “indispensable for being able to renew the treaty.”

But Trump said there were negative associations to the earlier trade agreement. “NAFTA has a lot of bad connotations for the United States because it was a rip-off,” Trump said.

He said that he would terminate “the existing deal” although it was unclear whether Trump has the power to do so unilaterally.

The surprising scenes of Trump and the Mexican president congratulating each other in front of news cameras on successful bilateral negotiations that left Canada out appeared designed, in part, to pressure Canada.

Peña Nieto wrote on Twitter that he has spoken with Canadian Prime Minister Justin Trudeau and expressed the “importance of rejoining the process, with the goal of concluding the trilateral negotiation this week.”

Peña Nieto’s administration wants to reach an agreement soon so that the Mexican Congress has enough time to ratify the deal before President-elect Andrés Manuel López Obrador takes office on Dec. 1.

Canadian Foreign Minister Chrystia Freeland is expected to rejoin negotiations in Washington on Tuesday.

A spokesman for Freeland said an agreement would require careful review and more discussions.

“We will only sign a new NAFTA that is good for Canada and good for the middle class,” the spokesman said. “Canada’s signature is required.”

Leading congressional Republicans cautiously welcomed Trump’s announcement, while making clear that they would not embrace a NAFTA 2.0 that leaves out Canada. “A final agreement should include Canada” in order to ensure that NAFTA continues to benefit American businesses and families, said Senate Finance Committee Chairman Orrin G. Hatch (R-Utah).

No. 2 Senate Republican John Cornyn (R-Tex.) said: “This is a positive step, and now we need to ensure the final agreement brings Canada in to the fold and has bipartisan support."

Even if a deal does ultimately make its way to Capitol Hill, Congress is certain to struggle to pass it given divisions over trade in both parties. The difficulties would only increase if the pact is not finalized before the November midterm elections and Democrats retake control of the House.

If Canada doesn’t sign off, it is unclear what Trump might do, as he has threatened to try to cancel the entire trade pact.

López Obrador has been supportive of the negotiations but would be likely to seek changes if the treaty is not completed before he assumes the presidency. His concerns about cementing Mexico’s energy privatization in a new NAFTA were among the final sticking points in the talks.

With only five days remaining for the United States and Canada to iron out their differences, negotiators realize they have exhausted all their wiggle room. “Realistically, it’s certainly tight,” the official said.

Larry Herman, a Toronto trade lawyer and former Canadian trade negotiator, said Canada has “every right” to examine the details of what was agreed to between Mexico and the United States and will then decide how to proceed.

“I think it’s appalling that Canada has been kept at arm’s length from these talks over the past number of weeks,” Herman said.

While Herman said he would expect Canada to resume participation in the talks, “there’s no way a NAFTA agreement can be ready for signature by the end of this month. It’s not going to happen.”

Trump has made renegotiating NAFTA a centerpiece of his economic and foreign policy agenda, arguing that the aging trade deal disadvantages American workers by luring U.S. jobs and companies overseas.

This approach has alarmed many Republicans, who support NAFTA’s free trade roots and worried about how Trump’s approach would impact farmers. But Democrats have mostly been split, as some agreed with Trump’s focus on manufacturing jobs but others worried about Trump’s take-it-or-leave-it negotiating style.

Having resolved some major sticking points with Mexico, the Trump administration is now expected to press Canada to accept quickly the consensus terms. But Trudeau, whom Trump criticized in harsh terms following the Group of Seven summit in Quebec in June, does not want to be viewed at home as conceding to the unpopular American president.

The NAFTA renegotiation has been a rocky one. The president over the past year repeatedly lambasted the original 1994 treaty, calling it a “bad joke” and blaming it for the loss of millions of American factory jobs.

One year ago, Lighthizer kicked off the negotiations by calling for a major overhaul of trade rules to take account of nearly a quarter-century of economic changes and to rectify the imbalance in trade between the United States and its southern neighbor.

Trump, he said, was “not interested in a mere tweaking of a few provisions.”

Jared Kushner, the president’s son-in-law and a senior White House adviser, has quietly worked with Mexico’s foreign minister and other officials to keep trade talks active, even amid the ups and downs of Trump’s combative relationship with Peña Nieto

Although trade deals are complex affairs that typically require years of glacial bargaining, administration officials initially hoped to finish the job by the end of 2017. They failed to meet that ambitious timetable and also blew through revised deadlines for the end of March and late May.

This time, the deadline may be real, given a congressional requirement for 90 days notice of an impending trade deal. If the administration doesn’t formally notify Congress that it has reached agreement with both Canada and Mexico by the end of August, Peña Nieto, the outgoing Mexican president, will not be able to sign it.

Negotiators want to get a deal wrapped up before López Obrador, who might demand additional changes, takes office.

Joshua Partlow in Mexico City and Alan Freeman in Ottawa contributed to this report.