BERLIN — Hungary and Poland's decision to block $2.2 trillion in European Union funds — including emergency pandemic financial aid — has deepened an existential crisis in the 27-member block over the fundamental liberal values it is supposed to represent.

As leader of the E.U.'s rotating presidency, German Chancellor Angela Merkel has been under pressure to find a solution that will persuade the populist leaders of the two countries to drop their vetoes and unlock the funding in time for an E.U. summit on Thursday.

The contention for Poland and Hungary is a clause that links the money to upholding the “rule of law” — judicial and political norms that underpin democracies — at a time when Brussels is censuring both for letting it slide.

A compromise appeared possible on Wednesday, as E.U. envoys discussed a bargain that would allow Poland and Hungary a potential face-saving way to back down without changing the legal substance of the measures.

Speaking to the German parliament, Merkel said she couldn’t yet say whether a solution — which would need support of other member states — would be reached. E.U. leaders said it would be further discussed Thursday.

The compromise under discussion puts loose limits on when sanctions can be triggered for violations of the E.U.’s rule of law standards, said E.U. diplomats, speaking on the condition of anonymity to discuss sensitive negotiations. But the fundamental legal basis of the measure would remain unchanged.

The deadlock has come at a critical time when European economies sorely need the aid after months of lockdowns and closures. But more is at stake than delays to the $900 billion in emergency funding and a $1.3 trillion seven-year budget.

The spat has struck at the heart of a rift in the European Union, engineered as a border-busting alliance of democracies that has struggled to deal with the question of what to do when member states stray from the shared values required to join.

Too much of a compromise on the side of Brussels and Berlin could be viewed as a message that such bullying tactics can succeed and that adhering to democratic norms is no longer a requirement to be an E.U. member.

“It’s a fight for the soul of the E.U.,” said Heather Grabbe, director of the Open Society European Policy Institute.

The confrontation between Hungary and Poland and the rest of the European Union has been brewing for years. Both governments have taken step after step to weaken the independence of the judiciary, undermine political opponents and entrench their own power and views, which include laws aimed at blocking refugees and erosion of press freedoms.

E.U. money has helped fuel the takeover of the systems in both countries — with Poland the biggest net recipient of E.U. funding in recent years and Hungary not far behind.

Cash from Brussels in both countries has been used to reward favored political allies with construction contracts, agricultural subsidies and a host of other initiatives. The river of money has flowed even as Hungarian Prime Minister Viktor Orban and Polish leaders have taken increasingly critical stances against Brussels at home.

Leaders elsewhere in Europe are under domestic pressure to take a tougher line, as their taxpayers question why their money is being used to prop up increasingly undemocratic governments.

As tension peaked, Dutch Prime Minister Mark Rutte told his parliament last month that the “nuclear option” would be to forge ahead with the budget and emergency package with just 25 member states — excluding Hungary and Poland from the funding.

The threat to cut out the two countries — at least from the emergency aid — was echoed by officials in Brussels.

Doing so would be damaging for all involved, Michal Baranowski, said the head of the German Marshall Fund’s Warsaw office.

“It’s a very high-stakes game for the European Union as a project, especially as all this is happening. We are still negotiating the final status of Britain after Brexit,” he said.

In recent weeks, threats to exclude Hungary and Poland have reignited their domestic debates about leaving the union.

“I think this would give centrifugal forces in the E.U. new energy,” he said.

Poland was set to be one of the biggest beneficiaries of the E.U. emergency funding, and the government is facing a backlash at home, where support for the European Union generally is high.

But the Polish leadership has backed itself into a tight corner, putting the ruling coalition at risk. Zbigniew Ziobro, the country’s hard-line justice minister, is threatening to withdraw his party’s support from the government if it backs down.

“The government walked itself onto a ledge basically and will need to find a way to walk down, but will need some help,” Baranowski said.

That appeared in motion on Wednesday. Gowin, Poland’s deputy prime minister, said that a deal could be finalized by the end of a two-day summit of European leaders in Brussels on Friday, according to comments published by Bloomberg News.

The deal will keep “Poland sovereign and the E.U. united,” he said.

“In Warsaw, they’ve realized it’s getting dangerous for Poland,” said Piotr Buras, head of the Warsaw office of the European Council on Foreign Relations.

If Europe bends too far, “it would be a very bad political signal, that if you are brutal at the E.U. level, you can achieve what you want,” Buras said.

Merkel said that Germany is looking at solutions that will bring a change in Hungary and Poland’s position “while maintaining this legal mechanism.”

Some analysts argue that it is time for Europe to address the issue head on, regardless of whether a deal is reached.

“This is the moment when they’ve got to start taking this really seriously,” Grabbe said.

The crisis comes as Merkel is at the helm of the E.U. presidency, in her last of more than 15 years as German chancellor.

“This depends hugely on Merkel,” Grabbe said. “Is she prepared to face down Orban?”

Birnbaum reported from Riga, Latvia.