IN 1989, during the dying days of the Soviet Union, a long-haired 26-year-old dissident called Viktor Orban addressed a crowd in Budapest’s Heroes’ Square. The charismatic young liberal told the Russians to withdraw from Hungary. He rejected “the dictatorship of a single party”. He called for free elections.

How things change. Today Mr Orban, Hungary’s prime minister, is one of Vladimir Putin’s closest friends in Europe. His country is increasingly dominated by one party, his own. Elections may be free, but they are not fair. Mr Orban has rewritten the constitution, dismantled checks and balances (“a US invention” unsuited to Europe, he says), muzzled the press and empowered oligarchs. Refugees, who supposedly threaten Hungary’s Christian identity, are beaten by police and mauled by police dogs. Debates over values, Mr Orban thinks, “unnecessarily generate social problems”. He wants to fashion an “illiberal state” modelled on China, Russia and Turkey.

Mr Orban has recently escalated his attack on Hungary’s remaining independent institutions (see article). In April his Fidesz party passed a law that threatens to close the respected Central European University in Budapest, which was founded by George Soros, a Hungarian-American philanthropist whom Mr Orban detests. Last week the government passed a law to force NGOs to disclose whether they receive foreign funds. Mr Orban’s creeping authoritarianism is not just a problem for Hungary. It is a direct challenge to the “fundamental values” of the European project—values that Hungary accepted when it ratified the Lisbon treaty. Where Hungary leads, others may follow; Poland already has. “We were black sheep, but now we are a success story,” Mr Orban crowed after the inauguration of Donald Trump, whose nationalism he admires.

For too long, the EU has turned a blind eye to Mr Orban’s excesses. Happily, that may at last be changing. There is talk in the European Parliament of stripping Hungary of its voting rights in ministerial discussions. For years Mr Orban has been lent a spurious respectability by Fidesz’s membership of the European People’s Party (EPP), a big group of centre-right parties in the European Parliament. Belatedly, the EPP’s leaders are publicly criticising Mr Orban; they should go further and kick Fidesz out of their club.

The EU should use upcoming budget negotiations to apply fiscal pressure, too. Hungary is a big recipient of the aid dished out to its poorer members, receiving nearly €6bn ($6.7bn) a year. More than 95% of public investment projects in Hungary are co-financed by the EU. In general the EU should stay out of members’ internal affairs, but governments that flagrantly violate democratic norms should face sanctions, such as receiving fewer handouts from EU structural funds. (German politicians favour similar sanctions for those, like Hungary, that fail to accept their share of refugees.) At the very least, the EU should do more to stop European taxpayers’ money from being stolen. The European Anti Fraud Office uncovered “fraud and possible corruption” amounting to €300m in the construction of just one subway line in Budapest (Fidesz blames the previous government). Hungary refuses to join the European Public Prosecutor’s Office, a new anti-graft body. Doing so should be a condition for receiving any more EU cash.

Hungary for justice

Some fret that if the EU confronts Mr Orban, he will try to turn Hungarians against it. But that would be a perilous strategy for him, and one he has already tried, with little success. Mr Orban has spent the past two years attacking Europe over its refugee policy, and has erected billboards across the country proclaiming “Let’s Stop Brussels!” Yet the EU remains popular. Three-quarters of Hungarians want to remain members of the union. More trust the EU than their own national government. A huge majority of Hungarians say it is “very important” to live in a place where democratic principles are respected, and while some do not think Mr Orban is violating them, others do. The memory of Soviet tanks on Hungarian streets still lingers; for many in Hungary, Europe represents freedom. The EU should not let them, or itself, down.