Venezuela’s chief prosecutor says she was sacked by the new constituent assembly because the government wanted to stop her investigations into alleged corruption and human rights abuses.
Luisa Ortega, a critic of left-wing President Nicolás Maduro, said she rejected her dismissal, condemned by other Latin American countries.
She will face trial for “serious misconduct”, the supreme court says.
Meanwhile, the regional bloc Mercosur has suspended Venezuela “indefinitely”.
The group says the country will not be re-admitted until political prisoners are released and the constituent assembly is scrapped.
Venezuela had been suspended temporarily in December for not complying with the bloc’s regulations.
On Saturday the assembly, which is dominated by government supporters, decided to remove Ms Ortega, 59, from office in a unanimous vote.
Ms Ortega was prevented from entering her office in the capital, Caracas, by dozens of National Guard officers in riot gear, and left on a motorbike amid chaotic scenes.
In a statement (in Spanish) released by the public prosecutor’s office, she said Mr Maduro’s government was leading a “coup against the constitution”.
“I do not recognize the decision,” she said about her dismissal. “[This is] just a tiny example of what’s coming for everyone that dares to oppose this totalitarian form of ruling.”
The supreme court, loyal to Mr Maduro, did not give details of the accusations against her.
Ms Ortega, who broke ranks with the government in March, had opposed the assembly’s inauguration on Friday, citing allegations of voting fraud.
Tarek William Saab, a supporter of President Maduro, has been sworn in as her replacement.
Her removal was widely expected but the fact that it was decided on the first working day of the assembly suggested that the new body could take aggressive measures against Mr Maduro’s critics, correspondents say.
Mexico, Peru and Colombia have condemned her dismissal.
Mr Maduro says the constituent assembly is needed to bring peace after months of protests sparked by severe economic hardship.
But the opposition says it is a way for the president to cling to power.
The new body has the ability to rewrite the constitution, and could override the opposition-controlled parliament, the National Assembly.
Julio Borges, speaker of the National Assembly, said Ms Ortega’s removal was illegal and showed that the country’s institutions had been “taken hostage by only one hand, only one political party” through “an undemocratic mechanism that is utterly dictatorial.”
Despite being oil-rich, Venezuela is experiencing severe shortages of food and medicines, as well as inflation in excess of 700%. Violent demonstrations since April have left more than 100 people dead.