CARACAS, Venezuela (AP) — Venezuelan opposition leader Juan Guaidó was violently blocked Sunday from presiding over a special session of congress where rivals proclaimed a substitute leader — moves opposition officials condemned as a hijacking of the country's last democratic institution.

Guaidó — whose legal challenge to the socialist government has been based on his role as head of congress — headed a small group of lawmakers trying to access the neoclassical palace where the opposition-controlled National Assembly was set to elect its leader for the final year of its 2015-2020 period, but they were pushed back by national guardsmen wielding heavy riot shields.

As scuffles broke out, the U.S.-backed leader tried to mount an iron fence surrounding the legislature, only to be repelled again.

Inside, the situation was similarly rowdy, as a rival slate headed by lawmaker Luis Parra tried to swear themselves in as legislative leaders with the support of socialist deputies loyal to President Nicolás Maduro.

There was no valid vote for Parra, the opposition said. Guaidó, who despite some defections still enjoys a comfortable majority in the 167-seat assembly, immediately denounced the impromptu session as a “show” carried out by a group of “traitors” in cahoots with President Nicolás Maduro.

“This is nothing more than another blow to our constitution," said Guaidó, whose blue suit was ripped apart during the chaotic standoff.

Still, senior Maduro officials celebrated the gambit as a comeuppance for the 36-year-old lawmaker, who has been struggling to maintain unity in the unwieldy opposition coalition.

Parra, meanwhile, called a session for Tuesday, setting up a fight over rival claims to the legislature's leadership in the days ahead.

A year ago, Guaidó asserted at a street demonstration that his position as legislative leader made him Venezuela's interim president in place of the “usurper” Maduro, whose 2018 reelection has been rejected as invalid by the legislature, as well as by the U.S., European Union and several Latin American governments. Key opposition figures were barred from running in that election.

There was no indication of weakening support among the more than 50 governments that recognize Guaidó as Venezuela's rightful leader. Brazil's government called the session an “affront to democracy,” while the top-ranking U.S. diplomat in Latin America called Sunday's events in the chamber a “farce."

"This morning’s phony National Assembly session lacked a legal quorum. There was no vote," Assistant Secretary of State Michael Kozak said on Twitter.

Those opposition lawmakers not in exile gathered later Sunday at the headquarters of El Nacional — the country's last major opposition newspaper — where they were expected to ratify their support for Guaidó.

Guaidó faced a major test in uniting articulating a new vision in his campaign to remove Maduro. But his reelection for a second straight year as head of congress had been widely expected.

The weeks leading up to Sunday's vote were marked by tension, with the opposition denouncing a covert government campaign to intimidate and bribe lawmakers into voting against Guaidó.

Parra is one of a small handful of lawmakers who recently broke with Guaidó and have since been expelled from their parties for alleged involvement in a corruption scandal involving allies of Maduro.

Socialist lawmakers argued that Guaido's absence forced them to initiate their session without him. But all day, opposition lawmakers faced resistance by security forces who set up several barricades downtown.

At one checkpoint, security forces demanded that each lawmaker present credentials, arguing they were under orders to deny entry to several lawmakers banned from carrying out their duties by the loyalist supreme court.

“Is your family in Venezuela?" Guaidó asked the young police officers, who stood firmly in nervous silence.

“Today you’re complicit with the dictatorship, you’re complicit with those who are responsible for the hunger inside Venezuela,” he added.

Support for Guaidó inside the opposition has taken a hit since several minority parties in November splintered off to create a separate bloc to negotiate directly with Maduro — something that Guaidó has refused, arguing that talks are simply a time-buying exercise aimed at keeping Maduro in power.

The small group of opposition lawmakers who broke with Guaidó argue that in stubbornly sticking to a naive plan of removing Maduro by force, he has put his political ambitions above the needs of Venezuelans who have largely tuned out from the political fight while enduring an economy in shambles and under stiff U.S. sanctions.

“In 2019 you represented the hopes of the nation, but today you're its biggest deception,” said José Brito, one of the lawmakers who turned against Guaidó amid accusations they used their position to enrich themselves and do the bidding of Maduro.

Venezuela sits atop vast oil and mineral resources, but it has been imploding economically and socially in recent years. Critics blame the plunge on years of failed socialist rule and corruption, while Maduro's allies say U.S. sanctions are taking a toll on the economy. The South American nation's 30 million people suffer soaring inflation and shortages of gasoline, running water and electricity, among basic services.

An estimated 4.5 million Venezuelans have abandoned their nation in an exodus rivaling war-torn Syria.

Maduro, who took over after the 2013 death of former President Hugo Chávez, says Guaidó is a puppet of the United States. Maduro also says he's determined to win control of the National Assembly in elections later this year.

“Despite perversions of the imperialist United States against Venezuela during 2019, we’ve managed to hold onto our independence, peace and stability,” Maduro tweeted recently.

Maduro maintains military backing and control over most branches of the government, despite the deepening crisis.

“Guaidó will have to not only re-energize his base and convince them to stay engaged, but keep his coalition in line as well,” said Geoff Ramsey, a researcher at the Washington Office on Latin America. “And the clock is ticking.”