People protest in the front of Parliament in Bucharest, Romania. (Daniel Mihailescu/AFP/Getty Images)

THE DEMOCRATIC revolution that swept across Central Europe following the collapse of the Soviet empire is in danger of being reversed. Hungary in recent years pioneered the construction of a de facto autocracy behind a shell of hollowed-out democratic institutions. Poland is now pursuing the same course. The European Union, to which both belong, appears unable to deter them. Perhaps because of that, a third post-communist country, Romania, is rushing to reverse anti-corruption reforms it adopted under pressure from Brussels.

Last week, the Romanian Parliament passed, with scant debate, three new laws that would curtail the powers of an anti-corruption agency and compromise the independence of judges and prosecutors. The attack on the National Anti- ­Corruption Directorate is particularly significant, as it has been responsible for hundreds of prosecutions of senior officials in the past decade, including 72 members of Parliament.

That neutering of the judiciary is not enough for members of the ruling Social Democratic Party (PSD), which has been at the center of Romania's endemic corruption. Its leaders are now proposing dozens of amendments to the criminal code and the code of criminal procedure that would shield political leaders from prosecution for offenses ranging from bribery to sexual harassment. In their zeal to protect themselves, legislators are proposing measures to strip police and prosecutors of vital powers, such as the ability to use evidence from surveillance cameras. They would ban public statements about investigations and trials and require that criminal suspects be allowed to witness police interviews with their accusers.

One of the biggest beneficiaries would be the PSD's most powerful figure, Liviu Dragnea, who has been convicted of vote-rigging and is under investigation for other crimes, including the misuse of $25 million in E.U. funds. The big loser is Laura Codruta Kovesi, the courageous head of the anti-corruption authority; the word in Bucharest is that the government will follow up its "reforms" by seeking her dismissal.

Fortunately, there is significant resistance from Romanians to this corrupt counterrevolution. President Klaus Iohannis has been strongly critical of the legislation passed last week. He can slow it down, though not ultimately block it, by returning it to Parliament, and he can prevent the dismissal of Ms. Kovesi. Romania's supreme court has already asked the Constitutional Court to nullify the new laws. Perhaps most importantly, tens of thousands of Romanians have taken to the streets of major cities in recent weeks to protest what is being called a "parliamentary coup."

Unfortunately, Mr. Dragnea and his clique are not easily deterred. After mass demonstrations earlier this year, they retreated from an effort to rewrite the criminal code. Now they have returned to it, evidently calculating that reaction from Romanians, or from abroad, will be less overpowering this time.

That's why honest Romanians need help from Western governments. The U.S. Embassy in Bucharest has spoken out strongly in favor of the rule of law, as have seven E.U. ambassadors. But Romania's Parliament should be hearing directly from leaders such as Germany's Angela Merkel and President Trump. It's not yet too late to stop the retrogression of democracy in Central Europe, but doing so will require urgent and concerted action at the highest levels.