BRUSSELS — A high-stakes legal battle between Poland and the European Union has escalated into a political crisis, with E.U. leaders threatening to withhold billions of euros from Warsaw, while debating how a bloc built on liberal values should confront democratic backsliding.

The conflict became supercharged this month when Poland’s top court ruled that the country’s national constitution trumps some E.U. laws — a direct challenge to the treaties and agreements that hold together the 27-member club.

“This is a much bigger crisis than the euro crisis, Brexit or the migration crisis because it undermines the whole foundation of the European Union,” said Heather Grabbe, director of the Open Society European Policy Institute. “And it also undermines democracy because you can’t have democracy without rule of law.”

The issue is overshadowing this week’s summit of European presidents, prime ministers and chancellors, which began Thursday. After a clamor by several member states, the subject of rule of law was added to the meeting’s agenda at the last minute, and some leaders have openly criticized Poland, calling for a forceful response to its posture.

“We must have this discussion — it is at the heart of Europe,” Belgian Prime Minister Alexander De Croo said as he arrived at the summit in Brussels. “You cannot be a member of a club and say: ‘The rules do not apply to me.’ ”

European Commission President Ursula von der Leyen warned Poland on Oct. 19 that a court ruling its constitution trumps European Union law would not stand. (Reuters)

For years, E.U. leaders have registered their disappointment as eastern members backed away from their commitments to democratic norms. Leaders used stern words as Poland constrained judicial and media independence. They issued warnings as Hungarian Prime Minister Viktor Orban deployed the tools of democracy to solidify his control.

But those eastern members have often looked to the European Union less as a beacon of democracy than a means of expanding economic opportunities, according to the bloc’s own opinion surveys. Consequently, many E.U. leaders have begun to embrace money — and the threat of cutting it off — as their most effective tool against backsliding on democracy.

The European Commission, the bloc’s executive arm, is holding up about $42 billion in grants and loans to Poland from its coronavirus recovery fund, and last month it asked the European Court of Justice to impose daily fines on Warsaw for defying its rulings.

After the latest Polish legal ruling, from a court closely aligned with the government, some European leaders and good-government advocates want the commission to go further by invoking a new, never-used tool that allows the European Union to block budget funds for states that fail to uphold the rule of law. That could freeze billions more bound for Poland, the largest recipient of the bloc’s money.

Top commission officials have indicated they are prepared to use the budgetary tool, known as the conditionality mechanism, but they have not laid out a timeline or specified target countries, which could include Hungary in addition to Poland.

On Wednesday, the European Parliament announced that it was preparing to file a lawsuit against the commission, accusing it of failing to act quickly enough to rein in Poland — an extraordinary example of tension between two E.U. institutions that underscores the prominence and political sensitivity of the debate.

Experts point to 2015, when Poland’s right-wing Law and Justice party came to power, as the beginning of a steady erosion of the independence of Polish civic institutions: Officials packed courts with political loyalists, turned public media into pro-government mouthpieces and sought to shut down dissent.

Poland’s increasingly strict anti­abortion laws and anti-LGBT policies have drawn criticism from across the world, especially in Europe. And rule-of-law audits have singled out Warsaw and Budapest as capitals of struggling democracies.

The latest and most serious chapter in the dispute with the European Union stems from changes to the Polish judicial system. As part of the Law and Justice party’s consolidation of judicial bodies and legal powers, the government established a “disciplinary chamber” that critics say is a tool to intimidate judges.

In July, the European Court of Justice ruled that the disciplinary chamber was “not compatible” with E.U. law and ordered Poland to suspend its activities. Poland’s Constitutional Tribunal — which itself is stacked with government allies and is considered illegitimate by many legal analysts — responded by ruling that the European court order was “inconsistent” with the Polish constitution.

The ruling foreshadowed that tribunal’s decision in October asserting that Poland’s constitution overrides E.U. law in some cases, an unprecedented strike at the bloc’s legal order.

“It paves the way for these challenges in other member states,” Grabbe said. “If it spreads to other member states, it is the end of the E.U.”

If the European Union does not respond forcefully, Grabbe said, it risks losing its credibility among Poles — who overwhelmingly support membership in the bloc — and in other member countries where citizens could become jaded as they see their taxes flow to authoritarian governments.

The tension was on full display this week at a hearing of the European Parliament in Strasbourg, France, where lawmakers clashed with Polish Prime Minister Mateusz Morawiecki and urged European Commission President Ursula von der Leyen to take more action.

“We expect the commission to do whatever it takes to halt the destruction of rule of law,” said Sophie in ’t Veld, a European Parliament member from the Netherlands. “Anything less would amount to a dereliction of duty.”

European Parliament member Lukasz Kohut of Poland’s Spring party aimed spirited criticism at Morawiecki, who was seated feet away on the floor of the chamber, accusing the prime minister’s Law and Justice party of “Euro-separatism.”

“Your place will be in the dustbin of history as the last vivid memorial to nationalism and populism,” Kohut said.

Morawiecki struck a defiant tone.

“I reject the language of threats, and I will not have E.U. politicians blackmail Poland,” he said.

He dismissed talk of a “Polexit” from the European Union, but he also echoed familiar criticisms of Brussels as an overreaching bureaucracy carrying out a “creeping revolution” through the rulings of the European Court of Justice.

“If you want a supranational state in Europe, first, why don’t you ask and get consent from all these sovereign member states?” Morawiecki said.

Morawiecki’s party is relying on E.U. funds to finance a key pillar of its political agenda, a package of social programs known as the “Polish New Deal,” which could be in jeopardy if the money is frozen.

The skirmish spilled over into the two-day summit, which was supposed to be headlined by discussions of soaring energy prices and migration. Instead, leaders were peppered with questions about Poland and the European Union’s response.

Dutch Prime Minister Mark Rutte, one of Warsaw’s most vocal critics, said Poland should not receive any new E.U. funds until it reforms its judiciary.

“I think we have to be tough, but the question is how do you get there,” Rutte said. “The independence of the Polish judiciary is the key issue which we have to discuss and we have to settle and where Poland has to take the necessary steps. That is nonnegotiable.”

Orban, who has allied himself with the Law and Justice party, was one of the few premiers to speak in Poland’s defense, echoing Morawiecki’s positions on the primacy of national constitutions.

“Poland — the best country in Europe,” Orban told reporters. “There is no need to have any sanctions. It’s ridiculous. . . . What’s the problem in Poland?”

Outgoing German Chancellor Angela Merkel, who has long performed a mediator role between central and Western European countries in rule-of-law disputes, cautioned the European Union last week against withholding the money, instead encouraging “in-depth” dialogue with the Polish government.

She said it was “saddening” that the European Parliament was pursuing a lawsuit against the commission and said it probably would be fruitless.

“We are all member states of the European Union,” Merkel said, “which means we have the duty always to try to find compromise — without giving up our principles, obviously.”

Quentin Ariès contributed to this report.