Imagine you want to do something nice for the world. Let’s say you believe in the virtues of democracy, freedom of speech and association, government transparency and that sort of thing. Perhaps you have personal experience with how awful life can be in countries that lack these civic features. How about starting an organisation to promote them?

Of course, it’s hard to build such an organisation without money. But what if, by fortunate coincidence, you are a canny trader who has made a vast fortune on the currency markets? If you were to launch such an organisation and donate hundreds of millions of dollars over several decades to promoting democracy and freedom all over the world, what sort of reaction might you expect?

If you are George Soros, and your organisation is the Open Society Foundations, the answer appears to be that you can expect to be denounced, harassed and demonised. You can expect to become the subject of wacky conspiracy theories with anti-Semitic overtones, and ultimately to have your operation chased out of the country of your birth by authoritarian thugs. These thugs have discovered that, by painting you as a sinister moneyman bent on destroying Hungary as Hungarians know it, they can win votes by persecuting your organisation.

Mr Soros, who is Jewish, was born in Hungary and experienced totalitarianism there under both the Nazis and the Communist regime, before emigrating to America. His philanthropic efforts took off in the 1990s as an effort to help post-communist countries such as Hungary transform themselves into liberal democracies.

Yet on May 15th, the Open Society Foundations announced that it is closing its office in Budapest and moving the operations to Berlin. The group said it could not continue to work in an “increasingly repressive political and legal environment”.

The phrasing is polite. Over the past two years, the government of Viktor Orban, Hungary’s increasingly autocratic prime minister, has passed laws requiring all non-profit groups that receive large donations from abroad to declare themselves foreign-funded organisations, and to post that information like a brand of shame on all printed or audiovisual materials they produce. It has accused Mr Soros of drawing up a secret plan to bring millions of African and Middle Eastern immigrants into Europe every year, in order to undermine Christian European culture.

Mr Orban’s Fidesz party campaigned in the recent election by plastering the country with ominous posters of Mr Soros. He has come to serve the same role for the government as Emmanuel Goldstein did for the totalitarian state in George Orwell’s “1984”: a mythical, shadowy enemy used to focus people’s hatred, and whose imaginary schemes supposedly justify the regime’s complete grip on power.

The conflict between Mr Soros and Mr Orban could not be more symbolically perfect. Mr Orban began his political career in the anti-communist protest movement of the late 1980s as a free-thinking student with liberal convictions. At one point he received a scholarship from Mr Soros’s organisation to study in Britain.

His turn against his erstwhile patron has something of an Oedipal quality, or perhaps “Paradise Lost”, with Mr Orban playing the rebellious angel. In 2014, in a speech that has become famous, he declared that he wanted Hungary to become an “illiberal democracy”—as complete a rejection of Mr Soros’s philosophy as one could imagine. More recently, he has turned to the term “Christian democracy”. What made Mr Orban’s demonisation of Mr Soros possible was the migration crisis of 2015. The spectre of over a million asylum-seekers, most of them Muslims from the Middle East, winding their way through Europe in search of safety allowed Fidesz to awaken voters’ latent xenophobia. Mr Soros exposed himself to attack by writing editorials laying out a rather reasonable plan for Europe to accept a substantial number of refugees, perhaps up to a million per year, both to alleviate suffering and to redress the continent’s growing shortage of labour. For an ethnic and religious nationalist party like Fidesz, the figure of a Jewish billionaire who supports large-scale Muslim immigration has been the perfect foil. Mr Orban and Fidesz are not yet done cementing their vision of illiberal democracy in Hungary. They have announced their intention to pass a so-called "Stop Soros" law that would make life even more difficult for NGOs that deal in any way with immigration issues, requiring them to register with the Interior Ministry and to pay a 25% tax on all foreign donations.

Schools are also in the crosshairs. Over the past year the government has been trying to use bureaucratic technicalities to close down the prestigious Central European University, also launched by Mr Soros in the 1990s and now one of the most respected academic institutions in eastern Europe. The university’s application for recertification is still pending. Its rector, Michael Ignatieff, a Canadian philosopher and former Liberal politician, says it does not plan to leave Budapest, but that it cannot start another academic year with its status uncertain.

Crushing the university would represent another victory in Mr Orban’s war on freedom of expression and association. It is a war that, for now, he seems to be winning.