CARACAS, Venezuela (AP) — Venezuelan opposition leader Juan Guaidó and lawmakers who back him pushed their way into the legislative building on Tuesday following an attempt by rival legislators to take control of the congress.

The man recognized by the U.S. and over 50 other nations as Venezuela’s rightful president took his seat at the National Assembly and led opposition lawmakers in boisterously singing the country’s anthem.

“This is a show of what can happen when we are united,” Guaidó yelled.

Shortly thereafter electricity in the building went out, but lawmakers continued in the dimly lit assembly, shouting into microphones that did not work to declare Guaidó the president of the only opposition-controlled institution.

He was then sworn in, holding up his right hand in the ornate room and pledging “in the name of Venezuela” to continue fulfilling his responsibilities as self-declared interim president “and search for a solution to the crisis.”

Venezuela’s opposition is facing its biggest test yet after government-backed lawmakers announced they were taking control of what Guaidó supporters have described as the nation’s last democratic institution.

Guaidó has served as president of the National Assembly for the last year and used it as his platform to gain international recognition. He was expected to be re-elected as the legislature’s leader Sunday but was blocked along with several other lawmakers from entering congress.

Former opposition ally Luis Parra declared himself the National Assembly’s leader, claiming to have won the votes of 81 lawmakers. The opposition refutes that tally and says 100 lawmakers, a majority, voted for Guaidó in a legislative session held at a Venezuelan newspaper.

Parra and his allies entered the National Assembly Tuesday ahead of Guaidó and began a session slated to discuss Venezuela’s gas shortages, among other woes. But they left as opposition lawmakers forced their way through several barricades of national guardsmen wearing helmets and carrying shields.

“We want to regain Venezuela, damn it!” Guaidó said as he and dozens of lawmakers pushed their way onto the legislative grounds.

For the last year, Guaidó has waged a campaign to remove President Nicolás Maduro from office after the socialist leader claimed victory in an election decried as illegitimate by the opposition, dozens of foreign nations and human rights observers. Though Guaidó garnered the enthusiasm of many Venezuelans who took to the streets to support him, his quest has fizzled in recent months.

An attempted opposition-led military revolt in late April failed to generate widespread support as Maduro maintains his grip on the armed forces. Guaidó’s popularity has slipped and many Venezuelans now say they are reluctant to heed his call to demonstrate, seeing it as a risky measure unlikely to generate any change.

Venezuela sits atop vast oil and mineral resources, but it has been imploding economically and socially in recent years, which critics blame on failed socialist rule. The South American nation’s 30 million live with soaring inflation and shortages of gasoline, running water and electricity, among basic services.

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