MEXICO CITY (AP) — In a bid to stoke nationalism and justify his policies, Mexico’s president has increasingly taken to calling his opponents “traitors” and accused them of working for the foreign governments.

Analysts say President Andrés Manuel López Obrador is starting to sound more like right-wing Hungarian Prime Minister Viktor Orban, calling anyone who opposes him a foreign agent.

The issue came to a head last week when President Andrés Manuel López Obrador tried to side-step court challenges to one of his pet projects by declaring a tourist train line “an issue of national security," without explaining why a tourism project warranted that status.

On Monday, the president said it was a case of foreign intervention by environmentalists paid by the U.S. government, a heady accusation in a country that has been invaded several times.

“Pseudo environmentalists come from Mexico City and other parts of the country, financed by the government of the United States, and they file these injunctions against us,” said López Obrador. “It is an issue of national security for many reasons, because a foreign government is interfering.”

Activist Pepe Urbina filed one of the court challenges that stalled the Maya Train project, which is cutting a swath through the jungle on Mexico's Caribbean coast. The project threatens extensive sinkhole caverns where some of the oldest human remains in North America have been discovered.

“They are slandering us, by claiming we work for the U.S. government,” said Urbina, who makes his living as a professional diver and denies receiving U.S. money. “It is absurd.”

The 950-mile (1,500- kilometer) Maya Train line is planned to run in a rough loop around the Yucatan peninsula, connecting beach resorts and archaeological sites. López Obrador has exempted it from environmental impact statements, but a judge disagreed and froze work on a 36-mile (60 kilometer) stretch of train line between Cancun and Tulum.

Antonella Vazquez, a lawyer who took on the appeals on a volunteer basis, also denied getting any U.S. government funding.

“It's shameful that they attack us, just to justify a national security designation that doesn't apply to a tourist train,” said Vazquez, who noted the judge in the case refused Monday to lift the work stoppage, even though the government has started to ignore it.

Vazquez says “I have received messages (on social media) that I am corrupt, or that someone is financing me or that I don't love my country. No! We aren't doing anything other than asking that the law be respected. ”

Over the weekend, López Obrador used similar language to attack anyone — environmentalists or businessmen — who opposes his plan to give dirty, fuel-oil and coal government power plants preference in electricity purchases, over private gas-fired, wind and solar plants.

López Obrador's actions on electrical power led the U.S. and Canadian governments to file complaint against Mexico under the U.S.-Mexico Canada free trade pact, which forbids discriminating against foreign companies.

“They are defending foreign oil companies, foreign electricity companies. They are traitors to the country!” López Obrador said of domestic opposition to his plans to favor the state-owned electrical company.

Mexican security analyst Alejandro Hope said López Obrador's comments “are like Viktor Orban, (Russian President Vladimir) Putin," noting the accusations “are crossing dangerous lines.”

“Social movements, non-governmental organizations are suspect by definition, and if they have any link to any international network, more so,” Hope said.

“What follows next is to criminalize the opposition, right? Treason is a crime in the penal code,” Hope said, adding “I don't think they're at that point yet, but they are putting that out there, on the table.”

Ivonne Acuña Murillo, a political science professor at the Universidad Iberoamericana in Mexico City, said López Obrador may be justified in thinking that Mexico's weak, disorganized opposition may in some cases be looking to score points abroad that it can't win at home, where the president remains largely popular. The opposition appears to agree on little other than its hatred for López Obrador.

“If we look at it in isolated fragments, one could think that the president is exaggerating or wrong on some points,” said Acuña Murillo. “But the context is that some people have taken systematic actions to block the Fourth Transformation (the term López Obrador uses for his government) in any way they can, to make the president's projects fail.”

“There is a fierce opposition that won't accept one single, not one single good thing the president has done, so that makes it hard for him to work with them,” she said. “And so the president gets in a bunker mentality in the face of constant, constant, constant attacks, and that could cloud his vision.”

With just about two years left in his six-year term and time running out on finishing his big pet projects — the tourist train, oil refineries, and several airports — López Obrador's level of rhetoric is likely to get more frenetic.

He certainly appeared to draw the line Sunday on the electrical power dispute in starkly nationalistic terms.

“We are not going to retreat one step,” López Obrador said of the electricity dispute, which could lead to U.S. trade sanctions. “Mexico is an independent country, it is not a colony of any foreign country, and the president of Mexico isn't a puppet, isn't the lackey of any foreign government.”

Copyright 2022 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed without permission.