The dire warning issued by the departing president of Poland’s highest constitutional court was one that should frighten not only the Poles, but people of all democratic nations in which populist rulers have taken or threaten to take power. Andrzej Rzeplinski, whose term expired on Monday, said that the governing Law and Justice Party is systematically weakening the checks and balances provided by the courts, the press and other institutions, and is leading the country “on the road to autocracy.”

Once the model of post-Communist transition to democracy, Poland has taken a sharp swing backward. The “reforms” enacted by the nationalist, right-wing Law and Justice Party, which won a majority in Parliament in October 2015, have strengthened the power of the executive branch over the news media, state prosecutors and nongovernmental organizations, and have undermined the independence of the constitutional court. Most recently, the government has cracked down on public gatherings.

In protest, hundreds of thousands of Poles have taken to the streets, creating a political crisis. Opposition legislators have occupied Parliament chambers, while the government has temporarily banned the news media from covering the tumult inside.

The court, which rules on the constitutionality of legislation and government actions, has been from the outset a major target of Law and Justice and its leader, Jaroslaw Kaczynski, who holds no office but wields the real power. He has called the court “the bastion of everything in Poland that is bad” for obstructing what he sees as the popular will as interpreted and expressed by him and his party. The government’s latest assault on the court has been a series of laws that would weaken its oversight role.