Mexicans on Sunday voted overwhelmingly for a leftist presidential candidate who called migration to the United States a “human right” and who promises to confront President Donald Trump.

The third time was the charm for Andrés Manuel López Obrador, who fell short in two previous runs for Mexico’s top office.

The 64-year-old former Mexico City mayor ran largely on a platform of combating domestic corruption and tackling poverty. He also benefited from the basement-level approval ratings of lame duck President Enrique Peña Nieto.

Exit polls indicated that López Obrador would win by a double-digit margin.

López Obrador’s election could have implications for U.S.-Mexico relations on issues such as the North American Free Trade Agreement (NAFTA) and immigration. During the campaign, he told the El Universal newspaper that he would defend the rights of migrants from the Americas and around the world.

At a campaign rally last month, he urged the Peña Nieto government to protest Trump’s now-ended policy of separating illegal immigrants from their children and request intervention by the United Nations. He also called on Peña Nieto to send a team of psychologists and lawyers to the border to help migrants wanting to enter the United States

“And soon, very soon, to the triumph of our movement, we will defend the migrants of the entire American continent and all the migrants of the world who, by necessity, have to leave their villages to seek life in the United States,” he said, according to the newspaper. “It is a human right that we are going to defend.”

Such rhetoric suggests the possibility of a breakdown of cooperation between U.S. immigration authorities and Mexico. It is a relationship that, despite tension since Trump’s election, has functioned fairly well up until now.

After Trump’s election on a platform of cracking down on illegal immigration, López Obrador traveled through America to advocate for Mexican immigrants and to promote a book called “Oye, Trump,” or “Listen Up, Trump.” In it, he blasted Trump’s proposal to build a wall along the border and “his attempts to persecute migrant workers.”

According to Politico, López Obrador told a rally of 90,000 supporters last week that Mexico “will never be the piñata of any foreign government.”

Who do you think would win the Presidency?

By completing the poll, you agree to receive emails from LifeZette, occasional offers from our partners and that you've read and agree to our privacy policy and legal statement.

Vox reported that López Obrador — who often goes by his initials, AMLO — has said Mexico would not “do the United States’ dirty work” by stopping Central Americans headed north.

Some American authorities have been frustrated by what they regard as a lack of urgency on the part of Mexicans to stop the tens of thousands of Central Americans who regularly make the long journey through Mexico on the way to the United States. But with López Obrador as president, the cooperation could get a whole lot worse.

López Obrador also could complicate ongoing efforts to amend NAFTA. Trump has called the 1990s-era trade pact unfair to the United States because it has resulted in a large trade deficit between the United States and its southern neighbor.

Officially, the López Obrador campaign was pro-NAFTA. Carlos Manual Urzúa Macías, whom the candidate designated to be the next finance minister if he won the election, said in April that López Obrador preferred a quick resolution to the NAFTA talks.

Related: ‘Stash Houses’ Keep Law Enforcement Busy as Illegals Hide in Texas Towns

“There’s absolute support for NAFTA,” he said, according to Bloomberg. “López Obrador has said that hopefully it’s held up so we can finish it, but there are advantages because the market could become a bit nervous if there’s no NAFTA and there are presidential elections at the same time.”

But many analysts speculate that López Obrador would not hesitate to allow the deal to disintegrate if negotiations with the United States and Canada broke down.

Critics of López Obrador question whether he will apply the same immigration standard he has called for regarding the United States to his own country. Dan Cadman, a retired U.S. immigration official and a current fellow at the Washington-based Center for Immigration Studies (CIS) noted on the think tank’s website last week that National Public Radio (NPR) in May detailed how unwelcome Central Americans feel when they cross illegally into Mexico.

“If López Obrador is as good as his word, then he should establish an amnesty that permits them (perhaps in perpetuity) to exercise their human rights to migrate to Mexico,” Cadman wrote.

PoliZette senior writer Brendan Kirby can be reached at [email protected]. Follow him on Twitter.

(photo credit, homepage image: Andrés Manuel López Obrador Saludando, CC BY-SA 3.0, by ProtoplasmaKid)