On June 21, Mr. Dragnea was found guilty of abuse of office for intervening to keep two of his party’s employees, who performed no state work, on the public payroll from 2006 to 2013, when he was a local council leader. The anticorruption agency — headed at the time by Ms. Kovesi — was instrumental in his prosecution.

Mr. Dragnea is appealing the verdict.

The public has pushed back against the government’s attempt to weaken the rule of law. In 2017, Romanians staged the largest street protests in a quarter of a century after an emergency decree was passed effectively decriminalizing low-level corruption. Antigovernment protests in Bucharest, the capital, last year turned violent when the police used tear gas and water cannons to disperse the crowds.

Ms. Kovesi served as chief prosecutor of Romania’s National Anticorruption Directorate from 2013 to mid-2018. The agency was created at a time when Romania wanted to show that it was making strong efforts to tackle graft.

Since parliamentary elections in December 2016, however, the government has regularly attacked the agency — and Ms. Kovesi in particular. Critics point to the agency’s reliance on court-approved wiretaps and have suggested political motives behind some of its cases.

“What she was trying to do during her two mandates was to show that the prosecutors have no fear, that they are independent and that they can get final convictions and those convicted will pay,” said Bianca Toma, program director at the Romanian Center for European Policies, a Bucharest-based think tank. “Politicians will always, in any country, try to limit the power of those trying to investigate them.”

Ms. Kovesi is now in the running to lead the European Public Prosecutor’s Office, a new, independent agency tasked with investigating and prosecuting large-scale and cross-border crimes related to the European Union budget. The agency is expected to be operating by the end of 2020, with 22 of the bloc’s 28 member states signed up.