The Polish election results this week were a disaster. Law and Justice's Andrzej Duda clinched victory on Sunday, with 51.21% against 48.79% for Civic Platform's centrist Rafal Trzaskowski.
The campaign was a grim homophobic and nationalist spectacle. Duda said that "LGBT are not people; they are an ideology". He branded anti-bullying education initiatives in schools the "sexualisation of children". Trzaskowski was accused of lacking a "Polish heart" or a "Polish soul". In the wake of the result, Nigel Farage said: "Good to see a Eurosceptic win in Poland."
Law and Justice will now continue to degrade Poland's constitutional infrastructure. It's not clear if the country can withstand another term of this before it ceases to function as anything resembling a liberal democracy.
The basic approach is similar to Viktor Orban's in Hungary. The domestic institutions are slowly replaced by party-controlled entities. Media outlets are taken over and either shuttered or turned into pro-government mouthpieces. The courts are packed with loyalists. Cronies are put in charge of scientific, historic and educational organisations.
Poland's public broadcaster, Telewizja Polska (TVP), which is supposed to function like the BBC, has been turned into a ferocious government attack dog, churning out hatred and division and singling out the opposition for attack. "In an evidently polarised and biased media landscape, the public broadcaster failed to ensure balanced and impartial coverage," monitors from the Organisation for Security and Cooperation in Europe said, "and rather served as a campaign tool for the incumbent."
The next attack will be against foreign-owned outlets, who are harder to bully than those which are domestically owned. During the campaign, Fakt, Poland's most popular tabloid, was singled out for criticism on the basis of its owners - Switzerland's Ringier Holding and Germany's Axel Springer.
"Does the Axel Springer company, with German roots, which is the owner of the Fakt newspaper, want to influence the Polish presidential election?" Duda said. "Do the Germans want to elect Poland's president?" Philipp Fritz, Warsaw correspondent for German paper Die Welt, was also targeted.
The government will now attempt to enforce a "Polonisation" of the media, eradicating foreign-owned outlets working in the country.
Attacks will also continue on the courts. The Constitutional Tribunal is weakened, the Supreme Court is stuffed with loyalists, the nomination process for judges is tinkered with. It's no longer possible to say that the country's judiciary is independent. The completion of that process is one of the government's key aims for its second term.
There is nothing exotic in all this. We see it in case after case, across the world, as the nationalist wave surges forward. Trump has tried to discredit courts because they have a "Mexican judge" or a "so-called judge" or an "Obama judge". He has railed against court efforts to establish the legality of his actions as the behaviour of the "deep state". In the UK, Supreme Court decisions guaranteeing the rights of parliament were greeted with front page newspaper headlines branding judges "enemies of the people". The attacks on the media follow the same depressing pattern.
The advantage countries like the UK and US have, which those like Hungary and Poland do not, is that their democratic institutions are old and confident, with a long heritage, so they can withstand attack far more effectively. It's honestly not clear that Poland can take another four years of this. By the next time it next holds a national election, the game may be so rigged that it is impossible to remove Law and Justice from power.
But regardless of the context in which it takes place, it's important to note the similarities in what we are seeing. Nationalism has distinctions. It is not as homophobic, or constitutionally extreme, in the UK as it is in Hungary or Poland. But the underlying attributes are the same: the desperate grasp for unchallenged executive power, the denigration of the domestic and international institutions, the worship of the nebulous and dangerous term 'the people'. What we're seeing in Poland is a version of what we're seeing in the UK and US. Take good note of it, because it's the same fight there as we face here.
Ian Dunt is editor of Politics.co.uk. His new book, How To Be A Liberal, is out later this year.
The opinions in Politics.co.uk's Comment and Analysis section are those of the author and are no reflection of the views of the website or its owners.