MEXICO CITY — Mexico’s incoming president, the leftist Andrés Manuel López Obrador, once railed against free-market policies and harbored deep misgivings about the North American Free Trade Agreement.
But hours after Canada joined an agreement between Mexico and the United States to revamp the 24-year-old trade deal, the president-elect and his aides on Monday hailed the last-minute negotiations that salvaged the trilateral accord.
“To us, the agreement looks to be very good for Mexico,” said Jesús Seade, who represented Mr. López Obrador on the Mexican negotiating team.
Both Mr. López Obrador, Mexico’s president-elect, and the center-right Enrique Peña Nieto, its president, welcomed news of the agreement, glossing over the fact that it included Mexican concessions — particularly in the auto industry, a key concern for President Trump.
Instead they pointed to the stability the deal ensured and to the removal of a burden that had been hanging over the country’s economy since Mr. Trump’s election.
The American president had called Nafta the worst trade deal in history and threatened to renegotiate it or withdraw. As the talks dragged on for months and stalled earlier this year, the risk that the accord could fall apart cast deep uncertainty over Mexico’s economic outlook.
“The culmination of this negotiation process promotes certainty in the financial markets and investment and job creation in our country,” Marcelo Ebrard, who will be Mr. López Obrador’s foreign minister, said in a statement Monday morning.
The three presidents have 60 days to sign the deal, whose timing was welcome for both the incoming and the outgoing leaders of Mexico.
For Mr. Peña Nieto, it is a win he can claim as part of his legacy. For Mr. López Obrador, it means the process will close before his Dec. 1 inauguration. That frees him from messy negotiations at the start of his administration and allows him to turn his attention to Mexico’s limping economy.
Since Nafta went into effect almost a quarter century ago, it has created a booming export economy driven by foreign investors who built factories across central and northern Mexico to supply the North American market. Last year, Mexico exported almost $410 billion worth of goods, more than 80 percent of that to the United States and Canada.
But at the same time, Nafta displaced millions of small farmers and local manufacturers. Successive governments have failed to come up with development policies to reincorporate them and stimulate the rest of Mexico’s economy.
The result is that overall poverty rates have barely budged in Mexico under Nafta and economic growth per capita has lagged behind almost every other country in Latin America — just 1.2 percent on average from 1996 to 2015, according to Santiago Levy, a Mexican economist who is vice president at the Inter-American Development Bank.
Mr. López Obrador, a former mayor of Mexico City, campaigned on restoring the forgotten sectors of the economy, particularly in Mexico’s underdeveloped south. Although he was once a fiery opponent of Mexico’s market reforms, he has changed his rhetoric against free trade, arguing instead that Nafta should be improved to benefit Mexicans, rather than overturned.
Tony Payan, director of the Mexico Center of the Baker Institute at Rice University, said the president-elect’s embrace of the trade deal revealed his realistic approach to governing.
“I think that most of us were always aware that there were two personalities to Mr. López Obrador,” Mr. Payan said. “One was an ideologue, a populist, thunder-and-lightning politician that was a critic of neoliberalism and the mafia in power.”
“But when you look at his record as mayor,” Mr. Payan said, “he was quite pragmatic.”
Mexico’s Senate, which fell under the control of Mr. López Obrador’s party in this year’s elections, must still approve the revamped deal, which is being called the United States-Mexico-Canada Agreement, or U.S.M.C.A. That vote is likely to move smoothly.
“Already there is a sign that he will instruct his political party to vote for this agreement,” Mr. Payan said of Mexico’s president-elect. “That is the pragmatic López Obrador that understands that Mexico is dependent on the economic relationship with the United States.”
The prudent approach to the new trade deal can help Mr. López Obrador’s economic team make the case to investors, who are wary of his populist promises that they will be good economic managers, said Christopher Wilson, the deputy director of the Mexico Institute at the Wilson Center in Washington.
Still, Mr. López Obrador clearly prefers for Mr. Peña Nieto to sign the deal before he leaves office, avoiding the appearance of owning a deal that many of his supporters dislike.
“The next administration wants to turn the page on this,” said Antonio Ortiz-Mena, a former Mexican trade official who is a senior vice president at Albright Stonebridge Group in Washington.
For the deeply unpopular Mr. Peña Nieto, whose party was so soundly rejected by voters that it has little more than 10 percent of the seats in Congress, signing the accord allows him to leave behind a signature achievement.
“It means that he leaves office having resolved the big threats that came from Trump,” Mr. Wilson said.
It also provides Mr. Peña Nieto with vindication for what many considered an unforgivable foreign policy decision: inviting Mr. Trump to Mexico in August 2016 during the campaign despite the invectives the Republican candidate hurled at Mexicans during his rallies.
“They made the bet that building a strong personal relationship with Trump and his team would pay off,” Mr. Wilson said. “This in some way vindicates that bet.”
Analysts are still parsing the details of the 500-page accord, but Mexico made important concessions. These include a requirement that to qualify for tariff reduction, a car must have 30 percent of the work done on it by workers earning at least $16 an hour beginning in 2020. That’s considerably higher than what a typical Mexican autoworker earns. That requirement will gradually move up to 40 percent by 2023.
Mexico also won an exemption on any future tariffs the Trump administration is threatening against auto imports of up to 2.6 million cars — well above the number that Mexico currently sends to the United States.
“The existing industry is protected,” said Luis de la Calle, a former Mexican trade negotiator, adding that trade deals with Europe, South America and parts of Asia under the Trans-Pacific Partnership mean that “Mexico is still an attractive place to invest.”
For its part, the United States dropped a demand for restrictions on Mexican fresh produce exports and agreed to a rolling review of the accord, rather than its earlier insistence that the agreement expire after five years unless the three countries agreed to renew it.
Mexico also managed to preserve parts of a dispute settlement provision that the United States had tried to eliminate, arguing that it amounted to an assurance for investors who were taking jobs to Mexico.
Mr. Payan said the final accord produced an unwieldy set of compromises among the three countries.
“I think Trump thought that Canada and Mexico would be pushovers and they dug in their heels on certain things,” he said.