Romania's top court on Wednesday told the country's president to fire the chief anti-corruption prosecutor, widely praised for her efforts to root out high-level graft, but a thorn in the side of some politicians.

The move angered some Romanians. More than 1,500 people gathered in protest in Bucharest, the capital, and hundreds rallied in the western cities of Timisoara and Sibiu calling the court "a slave" of the ruling Social Democratic Party.

The constitutional court ruled in a 6-3 vote that there had been an institutional conflict after President Klaus Iohannis disagreed with the justice minister's assessment that National Anti-Corruption Directorate Chief Prosecutor Laura Codruta Kovesi should be dismissed on grounds of failing to do her job properly.

In his February report calling for her dismissal, the minister, Tudorel Toader, said she was authoritarian, claimed that prosecutors falsified evidence and asserted that the number of acquittals was too high. He also said she had harmed Romania's image in interviews with foreign journalists. Kovesi later refuted his accusations.

Under her leadership, the agency has successfully prosecuted lawmakers, ministers and other top officials for bribery, fraud, abuse of power and other corruption-related offenses.

Kovesi's departure would be a blow to the agency, respected by ordinary Romanians, the European Union and the U.S. The court will explain its ruling later.