Latin America’s leftist-populist movement once led by Venezuela’s Hugo Chavez is in retreat, including a major electoral loss in Colombia over the weekend. But it stands to gain just south of our southern border, in Mexico.

That’s bad news for Latin America — and for us.

Polls on the eve of Mexico’s July 1 presidential election show Andres Manuel Lopez Obrador far ahead of his closest rival, Ricardo Anaya Cortes. If AMLO, as he’s known, wins, expect US relations with our 2026 World Cup-hosting partner to sour far beyond the bad blood caused by President Trump’s ugly invective against Mexico and Mexicans.

Repairing those relations will take decades, much to the delight of Latin America’s heirs in the Bolivarian movement founded by the late Chavez.

“The Bolivarians are desperate for a new leader, and they could find one in oil-rich Mexico,” says Douglas Farah, president of IBI consultants and a veteran Latin America watcher.

The Bolivarian losses intensified over the weekend, when Colombian voters gambled on a young unknown quantity, Ivan Duque, who handsomely beat the Chavez-like candidate, Gustavo Petro, in the presidential runoff election.

Colombians reacted to the much-heralded but flawed deal their outgoing president, Juan Manuel Santos, cut to end the government’s war on the Venezuela-backed narco-leftist guerrilla group known as FARC. They loudly rejected Petro, a former guerrilla himself. Petro was much too close to Caracas, and voters didn’t want Colombia to emulate their next-door neighbor as it disintegrates into poverty and crime.

The Colombia loss, along with other election defeats in the region, combined with Venezuela’s downward spiral, left the Bolivarians leaderless.

Enter AMLO. The former Mexico City mayor has tried hard in the last few months to shed his lefty-populist image and convince Mexicans he’s a centrist. No, he wouldn’t nationalize the oil and other industries. Not at first, anyway. Instead, he’d help the poor and middle class with free this and free that.

He failed to fully explain how he’d finance any of it, yet Mexicans, sick and tired of the systemic corruption and incompetence that have plagued the country for far too long, seem to be snared by his charms like college kids falling in love with Bernie Sanders.

AMLO’s main rival, Anaya, is a sensible centrist full of reform ideas. At 39, he’s much more innovative than the 64-year-old veteran who is trying for the presidency for a third time. Yet it’s AMLO who’s seen as the outsider who’d bring much-needed change to Mexico’s politics.

Meanwhile, the current Mexican leadership has walked on eggshells trying to avoid a clash with the White House. No longer. On Tuesday, Foreign Minister Luis Videgaray blasted Trump’s “cruel and inhumane” treatment of immigrant children at the US border.

Alas, that’s just a taste of what’s coming.

As Farah explains, relations between Mexican and American officials remain good. Trump’s endless griping aside, Mexico helps prevent a stampede on the border and, for better or worse, it closely cooperates with America on crime and drug smuggling.

Under AMLO, all this may change. His natural allies are America’s global competitors. “Imagine Mexico giving first intelligence dibs to Russia and China. Then we’re really screwed,” says Farah.

Latin America’s US-averse Bolivarians will find a new leader to replace the ever-sinking Venezuela. In the end, despite his attempt to fake a move to the center, AMLO is a known quantity, and any hope for a major political shift away from leftist populism tinged with anti-Americanism at his age is futile.

So Latin Americans dodged a bullet in Colombia. And, yes, the United States is deeply invested in defeating Colombia’s narco-traffickers and the FARC’s thuggish ideology. But its prominence for us pales compared with Mexico.

With $616.6 billion in trade in 2017, Mexico is our third-largest trading partner, to the benefit of both countries — never mind Trump’s wailing about deficits. It also shares a long land border with us and, wall or no wall, we need to cooperate to keep it as safe as possible. Whatever our complaints about Mexico now, they’ll intensify tremendously next year, if AMLO wins July 1.

Unless polls change in the final stretch, the shift will be felt regionally and globally, so fasten your seat belts. This could turn into a very bumpy ride.