MEXICO CITY (Reuters) - A day after winning the Mexican presidential election, Andres Manuel Lopez Obrador took a congratulatory call from U.S. President Donald Trump. But Trump had something more important on his mind: Would Mexico’s new president consider a bilateral trade deal?

FILE PHOTO - U.S. President Donald Trump talks via speakerphone to Mexican President Enrique Pena Nieto to announce a deal to replace the North American Free Trade Agreement (NAFTA) at the White House in Washington, U.S., August 27, 2018. REUTERS/Kevin Lamarque

Lopez Obrador responded he would be “open to the possibility” in the absence of a trilateral agreement that also included Canada, said Hector Vasconcelos, a foreign policy advisor to Lopez Obrador’s campaign who listened to the call on July 2.

Lopez Obrador’s answer marked a pivotal moment after a contentious year of negotiations between the United States, Canada and Mexico to rework the North American Free Trade Agreement (NAFTA), the framework for more than a trillion dollars in annual trade between the three.

Until then, Mexico and Canada had worked together to counter the economic and political clout of the United States as Trump demanded more favorable terms for the world’s largest economy and repeatedly called NAFTA a “disaster” for U.S. workers. But the election victory for Lopez Obrador, a leftist opposition candidate, gave Trump an opportunity to divide Mexico and Canada and cut a deal the way he wanted - one-on-one.

“I think I’m doing better with (Lopez Obrador) than the capitalist,” Trump told his supporters at a West Virginia rally last month, referring to Mexico’s outgoing president, Enrique Pena Nieto.

The shift in Mexico’s position came as the rival incoming and outgoing administrations realized that a deal with the United States before the presidential changeover would suit them both, according to interviews with more than a dozen people familiar with the talks.

Lopez Obrador’s new government was eager to sidestep conflict with Trump and focus on domestic issues. The president-elect - who has little enthusiasm for foreign relations - wanted to avoid the headache of navigating a complex trade negotiation left over from a previous presidency, said three senior officials with the incoming administration.

“The best foreign policy is domestic policy,” Lopez Obrador has said several times publicly.

Pena Nieto’s outgoing team wanted to rescue a tangible achievement from two years of bruising negotiations, which overshadowed the last third of his presidency, hampered investment and roiled Mexico’s currency, according to the sources familiar with the talks. While Mexican law doesn’t allow presidents to seek re-election, the candidate Pena Nieto backed lost by a wide margin.

Throughout most of the talks, Pena Nieto’s administration had reasoned that, together, Canada and Mexico had more leverage in negotiations that were stacked in Trump’s favor. Both economies depend heavily on U.S. customers, with Mexico sending about 80 percent of exports to the United States and Canada sending about 75 percent. Together, Mexico and Canada account for slightly more than a third of U.S. exports.

But on Aug. 27, less than two months after Trump’s call to Lopez Obrador, negotiators for the United States and Mexico struck a deal.

“Mexico had to look out for Mexico,” said Moises Kalach, head of the international negotiating arm of the CCE business lobby, which represented Mexico’s private sector at the NAFTA talks.

Mexican officials point out that Canada had previously signaled that it might take the same path. Early last year, the Canadian ambassador to Washington, David MacNaughton, said publicly that Canada would act trilaterally or bilaterally depending on its interests.

Canada’s office of Foreign Minister Chrystia Freeland declined to comment on the U.S.-Mexico deal or its impact on Canada’s ongoing talks with the United States. The White House did not comment in response to Reuters questions.

LEFT OUT

The U.S.-Mexico pact has prompted many of Canada’s business and political leaders to ramp up pressure on Prime Minister Justin Trudeau to cut his own deal with the United States.

Mexico weakened Canada’s negotiating leverage when it conceded on some issues important to Ottawa, including a mechanism to resolve disputes between NAFTA members known as Chapter 19, which Canadian officials say offers protection from unfair trade practices. Canada used the process to defend its lumber exports in the face of U.S. charges that the timber is unfairly subsidized.

Canada is also resisting U.S. demands to open the protected dairy industry to U.S. competitors.

Canadian officials believe Mexico gave up too much in the deal, said an influential private sector union leader with close ties to Canada’s negotiators.

“There’s a general feeling that the Mexicans capitulated in some key areas,” Unifor president Jerry Dias said in a phone interview.

DEADLINE FOR A DEAL

Pena Nieto needed an agreement by the end of August. Any later would have meant that he won’t be able to sign it before leaving office on Nov. 30 because it could take 90 days for the U.S. Congress to review and approve the deal.

Trump, a Republican, still faces opposition from some members of his party in Congress who favor a trilateral agreement, along with the risk that Republicans could suffer defeats in the upcoming mid-term elections on November 6 and lose their majority in the U.S. House or Senate.

Trump’s deal with Mexico could help his party in the elections because many states that helped elect the president in 2016, particularly in agricultural regions, would have been hurt by a breakdown in trade with Mexico, said Kalach of the CCE business lobby.

Personal connections also smoothed the path to a deal. Among those tasked with leading the Mexican negotiation was Luis Videgaray, foreign minister for the outgoing administration, who forged a relationship with Trump’s son-in-law and adviser Jared Kushner. The two men had met through Wall Street connections before Trump’s inauguration in 2017.

The arrival of Lopez Obrador’s chief negotiator, Jesus Seade, also accelerated the process, officials familiar with the talks said. Videgaray told Mexican television it was Seade who broke the deadlock over a U.S. demand for a so-called “sunset clause” that could kill NAFTA if it was not reworked in five years.

Videgaray’s connection to Kushner, a regular participant in the talks, proved vital in containing tensions and sustaining negotiations, said Gustavo de Hoyos, head of Mexican employers’ confederation COPARMEX.

“Videgaray has had the most access to the White House of any Mexican foreign minister in years,” he said.

TRADING CONCESSIONS

With a mutually agreeable end-of-August deadline in place, both sides came away from negotiations with some victories.

Mexico’s negotiators convinced Washington to drop a demand for curbs on seasonal food imports and to retain an exemption granted under NAFTA from industrial tariffs imposed by the United States under World Trade Organization (WTO) rules.

The United States will likely retain more auto-industry jobs after Mexico agreed to impose minimum salary requirements on the sector – at least $16 an hour for between 40 and 45 percent of workers, five times what most earn now.

Pena Nieto had resisted that request as a protectionist intrusion into Mexican labor issues. Lopez Obrador was more supportive, said Dias of the Canadian Union Unifor.

Lopez Obrador wants to improve wages and persuade Trump to help foster economic development in Mexico as a way to curb Mexican immigration to the United States.

For Mexico, pressing on without Canada would prove one of the most important concessions in opening the path to a deal.

“We had to decide whether we wanted to move forward with a deal which protected our country’s interests, or put those very interests at risk by waiting for Canada,” said Kalach of the CCE. “I think Canada would have acted similarly.”