Ms. Ortega had called the vote illegal and tried to block the assembly’s members from being seated. And after a software company that set up voting systems said the tally had been manipulated by at least one million votes, Ms. Ortega said she was opening an investigation.
On Saturday morning, the drama began as members of the National Guard carrying rifles and shields surrounded her headquarters in the capital, Caracas. Ms. Ortega took to Twitter to call the events a “siege.”
Ms. Ortega tried to enter the building but was blocked by members of the security forces. Video posted on social media sites showed the attorney general looking forlorn while retreating from the area, sandwiched between two men on a motorbike.
“We must continue to fight for freedom and democracy in Venezuela,” she said at a news conference afterward. “This country has lost its freedom.”
On Saturday, international criticism of the new assembly grew. Mercosur, South America’s largest regional trade bloc, suspended Venezuela, citing a “rupture to the democratic order.” Brazil and Colombia both called the country a dictatorship.
Mr. Cabello said Ms. Ortega would be replaced by Tarek William Saab, a close deputy of Mr. Maduro’s who has served as the top human rights official.
Mr. Saab has been criticized by members of the opposition for defending the government’s tough sentences for political prisoners.
In the days before the vote, the United States Treasury Department sanctioned Mr. Saab for failing to protect protesters from abuse by the security forces.
“As the ‘People’s Defender,’ it is ostensibly his role to stand up for human rights in Venezuela,” said the Treasury statement.
But he and other government officials had been involved in the “undermining of democracy, as well as the government’s rampant violence against opposition protesters and its corruption,” the statement said.
The sanctions were imposed on a total of 13 current or former senior Venezuelan officials.