Democracy is suffering in several European nations, including Hungary and Poland, according to a European Commission audit on the rule of law published Wednesday.

The new report, the product of months of work that put all 27 E.U. nations under scrutiny, reflected concerns that the European Union has failed to combat democratic backsliding among some of its members, though it has long prided itself as a bastion of liberal values.

The release of the report coincided with a preliminary agreement by European diplomats to tie access to E.U. funds to respecting the rule of law, as negotiations on a $2.1 trillion E.U. spending package accelerate in the coming weeks. Defenders of principles such as an independent judiciary and a free press have accused the European Union of enabling illiberal leaders by failing to cut off the money that props them up.

“We are trying to open a new chapter in defending and promoting the rule of law in the E.U.,” said Vera Jourova, the bloc’s rule-of-law chief. “Deficiencies often merge into an undrinkable cocktail, even if individual ingredients seem to be fine.”

The European Union was founded as a club of democracies, but it has struggled to intervene over the past decade as leaders in Hungary and Poland backed away from democratic commitments.

Hungarian Prime Minister Viktor Orban has imposed stringent controls over his country’s judiciary, channeled public advertising funds to pro-government media outlets and squelched opportunities for opposition voices to operate within Hungarian society.

And since Poland’s Law and Justice party won power in 2015, it has sought to place political allies in courtrooms, convert publicly funded media outlets into pro-government mouthpieces and threaten critics with legal peril.

“Poland’s justice reforms since 2015 have been a major source of controversy,” the E.U. report said. The report also characterized judicial independence in Hungary as “a source of concern.”

Both governments have already faced the threat of E.U. sanctions for their actions, but they have been able to use voting rules to defend each other and stifle significant consequences.

Each has complained about being singled out unfairly by fellow leaders for actions they say are legitimate because they were empowered by their citizens to run their countries.

In part as a response, the European Commission, the executive arm of the European Union, decided to assemble portfolios about every country in the bloc, cataloguing the state of corruption, checks and balances, justice and media freedom in sometimes dry legalese. Each country will face more detailed audits in the coming months and years.

Poland and Hungary came in for the toughest criticism, but the report also voiced concerns about corruption and the independence of the judiciary in Bulgaria, Croatia, the Czech Republic, Hungary, Malta, Romania and Slovakia.

Of those countries, all but Malta are former members of the communist bloc. But even countries with longer histories of democracy came in for some criticism: Austria, for example, was dinged for a lack of rules on how its government allocates its relatively high levels of state advertising to private media outlets.

Hungarian and Polish leaders both blasted the effort, saying they would found their own international rule-of-law institute to impose some counterprogramming on what they said was a biased message from E.U. headquarters in Brussels.

In a sign that it would not be cowed, Warsaw announced Wednesday that Poland’s effective leader, Jaroslaw Kaczynski, would return to front-line politics as deputy prime minister. The move gives the Law and Justice party founder direct oversight of Poland’s Justice Ministry, the target of much of the European Union’s criticism.

Przemyslaw Czarnek, who stirred controversy this summer with comments that LGBT people were not equal to others, was appointed education minister.

Polish Prime Minister Mateusz Morawiecki said the cabinet reshuffle would strengthen the government, which has been in crisis since Justice Minister Zbigniew Ziobro refused to back a bill proposed by Law and Justice in September.

In Hungary, Orban on Tuesday denounced the European Union’s Jourova for an interview she gave to Germany’s Spiegel newsweekly last week. In it, she said: “Mr. Orban is fond of saying that he is establishing an illiberal democracy. I would say he is establishing an ill democracy. Criticism of the Hungarian government can hardly be found anymore in the Hungarian media, such that a large majority of Hungarians is likely no longer able to develop an independent view.”

Orban called her criticism a “direct political attack” and demanded her resignation.

Inside Hungary, Orban critics said that even if European funding has enabled his rise, European criticism of him has also slowed some of his most far-reaching impulses.

“E.U. institutions matter, and E.U. pressure matters,” said Peter Kreko, executive director of Political Capital, a Budapest-based politics-focused think tank.

For example, Orban last year abandoned an effort to create a new administrative court system that prompted criticism about a lack of judicial independence, Kreko said. This year, the Hungarian leader handed back near-total emergency political powers that the Hungarian parliament rubber-stamped after the beginning of the coronavirus pandemic.

Kreko said Wednesday’s report could help further rein in European leaders who have been damaging the rule of law.

But E.U. money may be most important of all in shaping Orban’s willingness to bend to Brussels, and sharp divisions remain within the bloc about cutting off funds to countries that violate E.U. principles.

“One reason for the stability of this regime is that it receives a huge amount of E.U. funds, despite the fact that it ignores many of the fundamental values of the European Union,” Kreko said.

The E.U. discussion about whether to tie European funding to rule-of-law issues will heat up in the coming weeks, as negotiators intensify talks about the E.U. budget, the outline of which leaders approved in July. Some wealthy countries, including the Netherlands, Sweden and Denmark, have pushed for tougher conditions. A majority in the European Parliament, which will need to approve disbursements of the budget, also favors tough rules.

But Hungary and Poland oppose the effort, and they may succeed in watering it down.

Loveday Morris in Berlin contributed to this report.