The president of the National Regeneration Movement (MORENA), Andres Manuel Lopez Obrador, shows the document after registering himself as a pre-candidate for Mexico's presidential election in July, in Mexico City, on December 12, 2017.

The global economy is watching and waiting — nervously — to see whether President Donald Trump abrogates the North American Free Trade Agreement, something he threatened to do just last week while in Davos.

Yet according to analysts and investors, there's another acute risk haunting Mexico, in the form of its upcoming presidential election. Andrés Manuel Lopez Obrador (also known as AMLO), a firebrand populist, is now leading in the country's polls as the country gears up for a July vote that could have big implications for U.S.-Mexico relations.

A veteran politician who was once the mayor of Mexico City, Lopez-Obrador is making his third attempt at securing presidential power. Now, global investors are viewing his rise as a key risk ahead of the election, which could shake up the already tenuous state of NAFTA renegotiations.

Until now, the trade pact talks have been mostly viewed through the prism of domestic concerns in the U.S. — but popular opinion in Mexico is now becoming more of a factor.

"The market is not priced for this," said Jim Barrineau, portfolio manager and co-head of emerging market debt with Schroders Investment Management said, noting that the Mexican peso has performed strongly in recent weeks.

"Since last year when the earliest polls showed [Lopez Obrador] with a lead, he has been a concern to investors," Barrineau said. "The resonance of the corruption issue, which is the cornerstone of his campaign, suggests his lead may have staying power as the race heats up."

The commodities sector, one of the country's most prolific performers, the state owned oil company PEMEX—and its recent reform efforts — is being viewed as vulnerable if Lopez Obrador decides to "audit" the oil sector, analysts say.

"Even without explicitly rolling back the original reform, halting further oil sector opening would be seen as very negative," said Barrineau.