Over the past decade, Hungary and Poland have consistently undermined the rule of law and democratic institutions, which are supposed to be at the core of the European project. Hungarian Prime Minister Viktor Orban’s self-styled “illiberal democracy” is a misnomer: there is no longer any democracy to speak of.

Courts are increasingly under the control of Orban’s Fidesz party; the media have little freedom left; civil-society organisations operate under constant threat; and universities have already been stripped of what little autonomy they had.

In Poland, meanwhile, the similarly authoritarian ruling party, Law and Justice (PiS), has openly followed in Orban’s footsteps. Though it has not yet cowed civil society and the opposition to the same degree, it is steadily undermining the country’s democratic institutions.

From the EU’s perspective, the two countries’ refusals to participate in a new European Public Prosecutor’s Office should be the last straw. Launched in June, the EPPO has a mandate to investigate and prosecute fraud, embezzlement, and other crimes involving EU funds. Not surprisingly, there is ample evidence implicating both Fidesz and PiS in such abuses. By refusing to recognise the EPPO’s authority even as they continue to receive EU funds, Hungary and Poland are making a mockery of the European project and everything it stands for.

Moreover, there is now yet another argument for the EU to act against Hungary and Poland. From now on, Western countries will have to lead by example.

As US president Jimmy Carter said in his inaugural address: “The best way to enhance freedom in other lands is to demonstrate here that our democratic system is worthy of emulation.”

In new research examining data from more than 110 countries, Nicolas Ajzenman, Cevat Giray Aksoy, Martin Fiszbein, Carlos Molina, and I show that democratic institutions generate greater trust when they reliably deliver economic growth, peace, stability, and public services. Evidence from the past four decades suggests that democratisation proceeds in regional waves, partly because the demand for democracy spreads from one country to another.

Reversals of democracy have followed a similar pattern. When existing democracies appear less worthy of emulation, democratic institutions are less likely to spread.

These considerations apply doubly to the EU, given that its mission is to establish democratic institutions at the supranational level. At a time when global co-operation is needed more than ever, the EU’s historic experiment should be viewed as a success.

At the end of World War II, the continent was devastated and hollowed out economically, having poured all of its resources into armaments. While the United States was awash in modern technologies such as refrigerators, central heating, indoor plumbing, and civilian transport systems, these were nowhere to be seen in Europe.

In Britain, which had fared better than the rest of the continent, only half the houses in 1947 had hot water or indoor plumbing. In Germany, many major cities – including Hamburg, Cologne, Düsseldorf, Dresden, and Berlin – laid in ruins after Allied bombing raids. As many as 20mn Germans were homeless, and 10% of the country’s prewar population was dead. The rest of Europe was hardly much better. Occupied France, Belgium, and the Netherlands faced long recoveries after being savagely pillaged by the Nazis.

On top of it all, historic animosities – especially against Germany – were at an all-time high. Many assumed that communism or conservative dictatorships were more likely than democracy to take hold. Peace was viewed as tenuous at best.

But, as we now know, peace prevailed and democracy took root and blossomed in all of Western Europe, except Spain and Portugal (which remained under their own quasi-fascist dictatorships until later decades). Economically, the situation improved almost unbelievably; the three decades following the war came to be known as les trente glorieuses – the glorious 30 years.

More recently, the EU’s expansion to Central and Eastern Europe was initially a success, too. It is difficult to imagine that Hungary, Czechoslovakia, Poland, and the Baltic countries could have undergone so rapid a democratic transition without the prospect of EU accession and funding. And it is equally unlikely that Poland would have emerged as one of the world’s fastest-growing economies without the EU.

But the eastward expansion now looks like Europe’s Achilles’ heel. Hungary and Poland have come to symbolise the EU’s dysfunction and institutional weaknesses.

To be sure, expelling Hungary, and credibly threatening Poland with the same fate, is a serious decision that should not be made hastily. Any member state can elect a government that might try to weaken democratic institutions (as Italy did with Silvio Berlusconi, and as Britain has done with Boris Johnson).

Generally, the best way to deal with would-be authoritarians is to allow democratic institutions to do their jobs and trust voters to remove dangerous politicians.

But Hungary has become the exception that nullifies the rule. After more than a decade under Orban’s Fidesz Party, its democracy appears to have been fatally wounded, raising doubts that voters could ever remove the current regime.

The longer the EU continues to treat Hungary like a normal democracy, the more damage it will do to its own brand. It should start the process of changing its rules, so that it can take action against Hungary and Poland, even if these countries try to use their veto power. It should then invoke Article Seven of the

Treaty on European Union to suspend Hungary’s voting rights, and then stop the delivery of EU funds to the country while it works out the best way of terminating its membership. Barring some miraculous last-moment return to democracy, Hungary must go in order for the European project to survive.