There was much for President Trump to learn from his brief visit to Poland this week, but perhaps not the lessons he expected. The ruling Law and Justice party’s attack on Poland’s democratic institutions has thrown the country into a constitutional crisis and an increasingly serious confrontation with the European Union, of which Poland is a member. Assuming that the U.S. President paid attention, the turmoil in Poland should have served as an object lesson on the role of pluralism and independence of institutions in sustaining a democracy.

After winning elections in October 2015, the Law and Justice Party, led by Jaroslaw Kaczynski, made targeting the media one of its first priorities, starting with the influential public broadcaster. First, a temporary measure allowed the firing of the management and supervisory boards of the national television and radio broadcasters, allowing the party to replace them. A former party lawmaker became head of the TV station.

Then, the governing party passed a “bridge law” that created a new National Media Council that has party lawmakers as three of its five members. The effect on the public broadcaster of these changes has been striking: some 225 journalists have resigned or been fired, and the broadcaster’s news agenda now follows the government’s talking points in lock-step.

Private media are under pressure in more subtle ways, through a shift in advertising revenue from state-owned enterprises away from critics and towards pro-government outlets, and creeping restrictions on distribution of critical media at locations like state-owned gas stations. Journalists and outlets are grappling with shrinking access to government officials. Rhetorically, they face broadside attacks from a government that speaking of “re-Polonization” of the media, meaning ridding the sector of foreign ownership and eliminating “unpatriotic” views.

The ruling party’s campaign against the media is just part of a much broader assault on institutions encompassing the judiciary, civil society, and even museums. As in any country, Law and Justice justifies its actions through its own reading of Poland’s recent political history.

The party maintains that the transition from communism never genuinely happened, because the pact that ended the old regime without bloodshed meant that communists were never fully purged. Some, it claims, even benefited from the transformation.

Kaczynski’s party sees itself as now finishing the undone work of the transition, purging the state and society of the “red spiders” who survived. The accusation of complicity with the ancien regime has become a cudgel against even those who were at the forefront of the struggle against communism. This vision has become more conspiratorial since the death of President Lech Kaczynski, the twin brother of the Law and Justice leader, in a plane crash in the Russian city of Smolensk in 2010. Kaczynski insists that his brother was murdered, and holds the previous center-right Civic Platform government responsible.

More fundamentally, however, the party’s approach is grounded in an anti-liberal worldview that rejects the concept of independent institutions. In the famous formulation of the German anti-liberal philosopher Carl Schmitt, true politics consists of distinguishing between friends and foes. Liberalism’s weakness, Schmitt contended, is that it tries to evade this distinction by allowing a pluralism of views and interests, which can be reconciled through the functioning of accountable and impartial institutions. In a February interview with the German magazine Frankfurter Allgemeine Zeitung, Kaczynski cited Schmitt as someone who described politics “very realistically.”

Poland’s governing party has effectively declared war on pluralism. It rejects the idea that there is legitimate disagreement in Poland, or that such disagreement could be a good thing. It therefore dismisses the mediating functions of institutions as masking the raw exercise of power. Institutions must either be transformed into friends or treated as enemies.

This logic was on display last December, when the government tried to ban media from reporting within the parliament chambers, at a time when it was trying to pass a budget without adequate scrutiny from the opposition. When the opposition protested inside the parliament, and activists gathered outside, the government labeled it a coup attempt. The attempt to ban journalists was stopped after the uproar – but the captured state broadcaster ran a 30-minute special on the events titled “Coup.”

What is happening in Poland may seem extreme, but it should sound familiar to an American audience. The attacks on our media under the new administration, which has labeled news outlets “the opposition” and derided them wholesale as “fake news,” derive from the same illiberal playbook.

Trump’s hostile approach to the independence of the media—and of the FBI—is rooted in an assumption that institutions exist to serve the president’s prerogatives, not the constitution’s. The paradox of this hostility towards institutions is that in defending them, partisans of institutions are inevitably accused of playing politics, as seen in our current allegations of “deep state” revenge against the president. Thus our increasingly polarized political discourse, which dismisses out of hand the possibility of legitimate alternative views or the relative impartiality of institutions or information, falls further into the trap of the friend/enemy distinction.

President Trump would do well to think about what consequences come from treating the media as a hostile political power.