I first met Viktor Orban, the not-quite-dictator of Hungary, in 1989 in Budapest — and the man who introduced us was none other than George Soros.
Orban was then a firebrand student leader, anti-Communist and keen for Hungary to join the West. Soros, a Hungarian refugee who became an American billionaire, was devoting his time and money to finding and subsiding young Eastern Europeans who would lead their countries into the European Union and a liberal democratic future.
But Orban is now the Prime Minister of an "illiberal" Hungarian government that controls the mass media and regards the EU as the enemy.
In last April's election, he portrayed Soros as the Jewish evil genius who, with the EU's help, was planning to flood Hungary with Muslim refugees and destroy the country's culture and identity.
That's ridiculous, but Orban won almost half the votes and more than two-thirds of the seats in Parliament.
Poland, a far bigger country, now also has a far-right, "illiberal" government that is ultra-nationalist and hostile to the EU.
The extremists are not yet in power in other eastern European countries, but similar trends are visible in the Czech Republic, Slovakia and Romania. The dreams and hopes that drove the anti-Communist revolutions of 1989 are not yet dead, but they are definitely fading. What went wrong?
These countries are among the most ethnically homogenous in the world (due to the Holocaust and the widespread ethnic cleansing that followed both world wars). They have admitted almost no refugees, yet their politics is dominated by the fear of being swamped by them.
It's beyond bizarre, but Bulgarian political philosopher Ivan Krastev has a persuasive explanation for it.
He points out that the question "isn't so much where the nationalism has come from, but where it's been hiding all these years". His answer is that it was hiding in plain sight.
During the 1970s and 1980s, the nationalists who wanted independence from Soviet rule formed a close alliance with the pro-Western activists who wanted a liberal, democratic future.
From Poland to Bulgaria the liberals and the nationalists worked together, and even after the overthrow of the Communists in 1989 they continued to believe (or at least hope) that democracy could accommodate them both.
Maybe it could have, but the nationalist wars that destroyed the former Yugoslav federation in the 1990s put an end to the partnership. As Krastev says, the violence there persuaded liberals that "nationalism was the very heart of darkness, and that flirting with it could only be sinful".
So the liberals broke their alliances with the nationalists and, for a while, the nationalists went very quiet. Nobody, not even Polish or Hungarian nationalists, wanted to be seen in the same light as monsters like Serbia's Slobodan Milosevic.
But nationalism was the most powerful political force in eastern Europe throughout the 20th century, and it wasn't going to just fade away. It re-merged in the early 21st century, shorn of its liberal associations with tolerance and diversity, as a major political force in the region — and the driver behind it was what Krastev calls "demographic panic".
After 1989 many people in eastern Europe not only aspired to emulate the prosperous liberal democracies of western Europe, they actually wanted to live in them, and when their countries joined the EU they acquired the right to free movement.
If Poles thought that life would be better in England, for example, they could just move there and find work — and a million of them did.
Since 1989, 27 per cent of Latvia's population has emigrated to western Europe, and Bulgaria has lost 21 per cent. Hungary is not so hard hit, but it has lost 3 per cent of its population to western Europe in the past 10 years — and almost all the emigrants are young, leaving behind an aging population with a low birth rate.
This is the real source of the demographic panic, but it finds its political expression in a paranoid fear that the country's dwindling population will be over-run by immigrants with a radically different culture, particularly refugees.
It doesn't matter that there are virtually no immigrants in Hungary and that it's about the last place a refugee would want to go. In these matters, perception is all.
The anti-immigrant hysteria is almost universal in eastern Europe, and it will bring more illiberal nationalist regimes to power before it is finished.
The remedy, if there is one, is for the liberals to acknowledge the nationalists' concerns and rebuild the old alliances with them without pandering to the panic.
That's not easy to do, but it's what every western European democracy has actually been doing for generations.
Although they're not doing too well with it at the moment themselves.
Gwynne Dyer's new book is Growing Pains: The Future of Democracy (and Work)