Jaroslaw Kaczynski, the leader of Poland’s Law and Justice party, in Warsaw on Feb. 5. (Marcin Wziontek/Rex Features via Associated Press)

POLAND IS due to host a NATO summit next month, providing its eight-month-old government an opportunity to bask in international attention and celebrate the alliance’s bolstering of its eastern defenses. Unfortunately, the ruling Law and Justice party and its leader, Jaroslaw Kaczynski, are in danger of poisoning their own showcase. Rather than underline NATO’s determination to stand up to a heightened threat from Russia, the summit may be derailed by a divisive debate over another threat — to democracy and the rule of law in Poland.

If so, Mr. Kaczynski and his party will have only themselves to blame. Since taking office last fall under Prime Minister Beata Szydlo — Mr. Kaczynski chose to rule from behind the scenes — Law and Justice has moved aggressively to bring Poland’s security services, the state media and, most troubling, the judiciary under its control. The aim appears to be to push Poland down the same quasi-authoritarian path blazed by Hungary’s Viktor Orbán, who has curtailed media, civic and religious freedoms while proclaiming his contempt for liberal democracy.

In addition to prompting the rise of a mass domestic opposition movement, Mr. Kaczynski’s maneuverings have now drawn the censure of the European Union’s executive branch, the European Commission. Last week it adopted a formal opinion that Poland had compromised the rule of law in its tampering with its constitutional court. Shortly after taking office, the new government sought to revoke several appointments to the court, pack it with its own nominees and change its procedure to require that its rulings be backed by a two-thirds majority of the justices. When the court found these actions unconstitutional, the government refused to accept its decision.

The E.U. ruling was not precipitous; it came after months of discussions and negotiations led by Frans Timmermans , the commission’s first vice president. Until recently, it appeared a compromise could be struck under which Law and Justice would give ground on the court’s membership and yield on the voting rules. But Mr. Kaczynski retreated from the deal, thereby forcing the commission’s hand. Now Poland must respond to the E.U. finding or face at least the theoretical possibility of sanctions.

The E.U. action has been greeted with public defiance by Mr. Kaczynski and his circle, some of whom appear to believe they can ride out the censure. The cockiness is shortsighted. Whether or not the commission’s process goes forward, Poland’s behavior could well discourage some NATO governments from supporting or contributing to a plan to station troops and equipment in Poland in order to deter Russian aggression.

The Obama administration, which has been a prime promoter of that plan, will no doubt stick to it. But President Obama should be prepared to forcefully and publicly challenge the Law and Justice government over its democratic violations if it does not correct them before his arrival in Warsaw. Mr. Kaczynski must understand that his policies threaten to wreck relations with the United States — and thereby undermine Polish security.