BUCHAREST (Reuters) - Romania’s president must dismiss the chief anti-corruption prosecutor to resolve an institutional conflict with the government, the Constitutional Court said on Wednesday, in a ruling that leaves prosecutors vulnerable to political interference.

FILE PHOTO: Romanian President Klaus Iohannis arrives at a European Union leaders summit in Brussels, Belgium, March 22, 2018. REUTERS/Francois Lenoir/File Photo

An estimated 2,000 people gathered outside government headquarters after the decision, chanting “Dictators” and “Rats.”

The ruling, approved by 6 votes to 3, limits the president’s powers and gives the justice minister, a political appointee, more control over prosecutors in one of the European Union’s most corrupt states.

Since Laura Codruta Kovesi took over the anti-corruption prosecuting agency DNA in 2013, conviction rates have risen sharply, winning praise from Brussels, which has Romania’s justice system under special monitoring.

But Justice Minister Tudorel Toader called for Kovesi’s dismissal in February, saying she had exceeded her authority and damaged the country’s image abroad. His request drew thousands of anti-graft protesters onto the streets.

The country’s judicial watchdog said the request was unfounded and President Klaus Iohannis rejected it, prompting the government to ask the top court to decide whether his rejection had created an institutional conflict.

Legally, the president has final say in the dismissals of chief prosecutors, which are requested by the justice minister and need approval from the judicial watchdog.

But on Wednesday, the court ruled the president does not have the constitutional right to oppose a dismissal request legally initiated by the justice minister. Instead, he is limited to assessing the legality of the procedure.

“The president has refused to issue the dismissal decree based on opportunity, not legality arguments, which has blocked the justice minister from using his authority on prosecutors’ activities,” the court said in a statement.

“The constitutional conduct that must be followed ... is for the president to issue the dismissal decree.”

The court’s rulings are binding. A full explanation of its decision will be released later. Earlier on Wednesday, Iohannis told reporters he would wait for the explanation before acting.

Judges, prosecutors and legal experts have said the ruling would open the way for further dismissals and would damage investigations of high-level graft. Ruling Social Democrat politicians, whose leader is on trial for abuse of office, welcomed the decision.

“After the ruling, I have three words: Codruta, go home,” Florin Iordache said. Iordache, a lawmaker and former justice minister, was behind a move by the government in early 2017 to decriminalize several corruption offences. The effort triggered Romania’s largest protests in decades.

DNA has investigated lawmakers, ministers and mayors in recent years, exposing conflicts of interest, abuse of power, fraud and the awarding of state contracts in exchange for bribes.

“At a first reading, the president can still reject the dismissal if he can find legality arguments,” legal expert Laura Stefan said. “But the decision does reduce the president’s abilities and enhances the justice minister’s.”

Opinion surveys have shown Romanians had more confidence in the judiciary than in parliament or government.