CARACAS (Reuters) - Venezuela’s pro-government legislative superbody ruled on Wednesday that parties who boycotted this month’s local elections had lost legitimacy, potentially eliminating the main opposition groups from the 2018 presidential race.

Venezuela's President Nicolas Maduro speaks during a military parade in Maracay, Venezuela, November 27, 2017. Miraflores Palace/Handout via REUTERS

The decree by the Constituent Assembly - created in a controversial July vote boycotted by the opposition and widely condemned abroad - infuriated Venezuela’s opposition and drew criticism from the United States.

“The Venezuelan government and its illegitimate Constituent Assembly are inventing rules as they go along. This is not democracy,” the U.S. Embassy said on Twitter.

The Justice First, Democratic Action and Popular Will parties did not run candidates in this month’s mayoral polls in protest against what they said was a biased election system designed to perpetuate leftist President Nicolas Maduro’s “dictatorship.”

Maduro had warned that could cost them participation in future votes and the Constituent Assembly echoed that position on Wednesday, saying the parties had lost their legal status and should re-apply to the National Election Board.

Given that the board is pro-Maduro and authorities are constantly throwing up obstacles to the opposition, that could well mean those parties are now effectively unable to run in the presidential election due before the end of 2018.

Maduro, 55, is expected to run for re-election despite the disastrous state of the economy in Venezuela, where millions are skipping meals and struggling to survive amid one of the world’s highest inflation rates and widespread shortages of basics.

Two of his potentially biggest rivals already cannot run against him: Popular Will leader Leopoldo Lopez is under house arrest, while Justice First leader Henrique Capriles is prohibited from holding political office.

“We alert the world and all democratic governments that banning opposition political parties is yet another measure by the dictatorship that deserves rejection and condemnation,” said Capriles’ party colleague Tomas Guanipa.

Maduro and his allies say the Constituent Assembly has brought peace to the OPEC nation after months of opposition protests earlier this year in which more than 125 people were killed. Demonstrators said they were fighting for freedom, but the government condemned them as violent subversives.

“It’s time for the coupsters to face the constitution. Let no one undermine the people’s participation and the democratic system,” Constituent Assembly head Delcy Rodriguez said after the passage of Wednesday’s measure.