Jaroslaw Kaczynski, leader of the ruling Law and Justice party in Poland. (Agencja Gazeta/Reuters)

A GENERATION ago, Poland led the struggle to replace totalitarianism in central Europe with liberal democracy. Now, unfortunately, it has joined the vanguard of a counterrevolution that would dismantle the core institutions of a free society. In the past few days, its right-wing nationalist government has struck major blows against judicial independence and independent media. It appears to believe that neither the European Union nor the United States has the means or will to hold it accountable — and it may be right.

The first step by the ruling Law and Justice party was the passage through the lower house of Parliament on Friday of laws that would radically change the composition of the Supreme Court. The retirement age for judges would be lowered from 70 to 65, compelling perhaps 40 percent of the more than 80 sitting members to step down — unless the president, a Law and Justice partisan, gave them an exemption. Meanwhile, the body that nominates new judges would be changed so that a majority of its members would be chosen by Parliament, rather than by other judges.

A report by the Venice Commission of the Council of Europe rightly concluded that the law, expected to be quickly approved by Parliament's upper house, would "enable the legislative and executive powers to interfere in a severe and extensive manner" in the courts. Among other things, Law and Justice would be able to appoint a majority in a new Supreme Court chamber judging electoral matters.

The second strike came Monday, when a government-controlled media authority leveled a $420,000 fine on the country's most important independent news broadcaster. Its offense was covering a protest demonstration earlier this year. That follows a dubious $30 million tax bill the television channel, TVN24, was handed in July. The station, owned by Scripps Networks Interactive, is one of the largest U.S. investments in Poland. But Law and Justice leader Jaroslaw Kaczynski, following a playbook pioneered by Vladi­mir Putin, appears intent on forcing TVN24 to adopt a pro-government line, or else be sold or shut down.

Poland's actions clearly violate the democratic norms of the European Union, and its ruling commission has begun a disciplinary process that could, in theory, lead to fines or the loss of voting rights. But both E.U. and Polish leaders know those actions are likely to be stymied; they must be taken by a consensus of the bloc's 28 members, and Hungarian strongman Viktor Orban, who is guilty of the same offenses, will object. Some European officials have talked about trimming E.U. budget funds for Poland. That might get the attention of Mr. Kaczynski, who has long been hostile toward the union but wants to keep its cash coming.

Mr. Kaczynski is not an accountable ruler. He declines to take a government job, instead shuffling subordinates in and out of the prime minister's office. He does value Poland's traditionally strong alliance with the United States and has courted President Trump, who visited Warsaw in July. Mr. Trump had nothing to say then about the rule of law or media freedom. If he remains silent now, Poland's counterrevolution will be further encouraged.