CARACAS, Venezuela — The government of President Nicolás Maduro staged a de facto takeover of Venezuela's legislature on Sunday, swearing in its own candidate as head of the National Assembly in a move apparently orchestrated to rob international credibility from Juan Guaidó, who had led the body and has staked a rival claim as head of state.

The dramatic events marked a sharp escalation in Maduro’s gambit to end Guaidó’s quest to unseat him and stoked immediate outrage in Washington — which has strongly backed Guaidó and condemned Sunday’s action. Opposition officials declared the move an effective “parliamentary coup” meant to consolidate Maduro’s near-dictatorial powers.

“Parliamentary coup by the Maduro dictatorship against the National Assembly,” Guaidó’s communications team said in a tweet. “Without a vote or quorum, ruling-party lawmakers and corrupt lawmakers swear in a false leader.”

The replacement of Guaidó amounted to a bait and switch. On Sunday, he began the day anticipating his reelection as head of the National Assembly, viewed internationally as the last democratic institution left in the authoritarian South American state. Guaidó’s claim as the nation’s true president — recognized by nearly 60 countries, including the United States — has been based on his status as the assembly’s chief.

But security forces loyal to Maduro formed a cordon around the assembly building in central Caracas, blocking opposition lawmakers — who control the chamber — from entering. Lawmakers who back Maduro — including several allegedly involved in a government plot to buy votes — were allowed to pass. At one point, Guaidó sought to scale the spiked wrought-iron fence surrounding the assembly, trying to force his way in.

At the same time, Luis Parra — a former opposition politician who was one of several lawmakers accused last month of accepting government bribes — announced his surprise candidacy against Guaidó on Twitter on Sunday morning. Hours later, his swearing-in was suddenly shown on state television.

Parra is thought to have had the support of at least 40 lawmakers from Maduro’s party and an unknown number of others who the opposition claims to have been bribed. But there was no evidence that an actual vote had taken place. The opposition insisted that the vote was illegal because there was no quorum of lawmakers in the chamber.

“Today we want to open the doors to the future of this parliament,” Parra said in televised remarks after his swearing-in. “To the people that today expected a different message, we will continue to seek reconciliation”

Opposition officials said Guaidó would seek to counter Sunday’s move by gathering as many lawmakers as possible in an undisclosed location to hold their own vote on the chamber’s leadership.

The government’s action appeared designed to complicate Guaidó’s international recognition and provide some nations that might be considering pulling its support additional legal cover to do so. No longer being the technical head of the chamber could put his constitutional claim to the presidency in question for some nations.

But his strongest backers — particularly in Washington — are likely to continue and perhaps even redouble their support for Guaidó. The move comes as the United States — which has slapped tough sanctions on Maduro’s government, including an oil embargo — is weighing more confrontational steps, including a possible naval blockade of Venezuelan oil being shipped to Cuba, the Maduro government’s chief regional ally.

“What the regime is doing now at the National Assembly goes completely against the will of the people and the laws that govern the process,” the U.S. mission to Venezuela, based in Colombia since the severing of diplomatic ties last year, said in a tweet. “Democracy can’t be intimidated.”

Faiola reported from Miami.