Last Sunday, Mr. Maduro held a contentious election to secure control over the country. In the vote, Venezuelans were asked to choose delegates from a list of allies in the governing party who would rewrite the Constitution and rule the nation while they did so. Voters were not given the option of rejecting the plan.
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, 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.
Ms. Ortega was 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,” the Treasury statement said. But he and other officials had allowed “rampant violence against opposition protesters.”
The sanctions were imposed on a total of 13 current or former senior Venezuelan officials.