Whom does Mexico favor in November?

Last December, the rumor running through the Mexican political class was that President Andrés Manuel López Obrador wanted to throw the U.S. presidential election to Donald Trump.

Blaming a cash shortage, the Mexican migration authority had essentially stopped intercepting migrants moving north through its territory toward the United States. Migrant encounters with U.S. agents at the southern border surged to over 300,000, the highest monthly tally on record. Republicans had a field day accusing the Biden administration of allowing chaos at the border.

“López Obrador had the key to the White House,” noted Rafael Fernández de Castro, who directs the Center for U.S.-Mexican Studies at the University of California San Diego. “If migrant flows had stayed at the same levels of 2023, it would have sunk the Democrats.”

But they did not. Just after Christmas, President Joe Biden dispatched Secretary of State Antony Blinken and Homeland Security Secretary Alejandro Mayorkas to Mexico City, and the Mexican government found the wherewithal to help. By January, migrant encounters with U.S. Border Patrol agents had fallen to 176,000. By August they had declined to under 108,000.

Political observers remain a little puzzled about the Mexican president’s seeming about-face. A self-proclaimed champion of the left, AMLO, as he is popularly known, had shown a somewhat perplexing affinity for Trump, who he called soon after winning the presidency to celebrate how they both had managed to “displace the political establishment.”

Perhaps he realized Trump’s promises to deport migrants en masse, launch missiles and send kill squads to take out drug cartel leaders south of the border were a bit too much to stomach. Perhaps Blinken promised Washington would lay off the Mexican government on other touchy subjects. Maybe keeping the migrant fire hose open could backfire in some other way?

Or perhaps he simply bowed to the wishes of Mexican citizens, who have preferred the Democratic candidate in every presidential election since 2004, according to polls by El Financiero newspaper. An August survey found 67 percent of Mexicans prefer Kamala Harris to beat Trump in November.

In any event, López Obrador’s meandering affinities mirror Mexico’s deep ambivalence about American politics and its leaders, whether Democratic or Republican.

Mexico’s political discourse has long been colored by mistrust of the United States, the product of a long, often strained relationship that included losing a big chunk of territory in the 19th century. In his book “The Merchant of Silence,” Mexican writer Enrique Serna recounts how movie audiences during World War II showed their feelings toward the United States by applauding whenever Hitler or Mussolini appeared on the newsreel.

Most Mexicans today, who often have either a personal experience of living in the United States or a bunch of relatives there, are not quite that hostile. Indeed, 72 percent of them have a favorable view of the neighbor to the north, according to the 2023 poll by Latinobarometro.

Mistrust nonetheless plays a defining role in the bilateral relationship. Generally speaking, the left side of Mexico’s political class does not believe gringos’ stated intentions. They get triggered when Washington claims the right to butt into another country’s affairs in the name of high principles, whether it’s protecting human rights, defending democracy or whatever else.

Trump might be a Mexican-hating bully, but his interests in the country were limited to stopping migrants and managing trade. He didn’t much care whether López Obrador wanted to dismantle the institutions underpinning Mexico’s liberal democracy. He was transactional, always ready to make a deal. He didn’t hide his true intentions. He was manageable.

Trump remained deeply unpopular in Mexico throughout his administration, according to El Financiero’s polls. And yet the share of Mexicans with a favorable view of the United States rose from a low of 24 percent in the early months of 2017 to 60 percent by the end of 2020.

Democrats, on the other hand, have a known appetite for interventionism. U.S. Ambassador to Mexico Ken Salazar got a taste of Mexico’s sensitivities when he dared to offer mild criticism of AMLO’s plan to dismantle Mexico’s judiciary. Harris may be preferred by most Mexicans, but the Mexican political class does not necessarily trust her. That portends a rocky road over the next four years for North America’s most important bilateral relationship.

The prospect of Trump 2.0 might be a nightmare too horrid to contemplate from Mexico City. But a Harris administration will also be difficult for Mexico to manage. The bilateral agenda has plenty of issues that can prove explosive. There’s migration, fentanyl trafficking and the expanding footprint of Mexican organized crime; there’s Mexico’s retreat from the path toward liberal democracy. And Washington’s newfound bipartisan hostility toward trade bodes ill for the trade agreement binding the two countries, which is up for renegotiation two years from now.

AMLO’s control of the migration valve may have insulated his government from Washington’s meddling. But that tense, unstable equilibrium is unlikely to survive under the government of López Obrador’s anointed successor Claudia Sheinbaum, whose six-year term begins on Tuesday. One way or another, Washington will butt in. And the Mexican government is not going to like it.