The European Union's top court has dismissed a Polish and Hungarian challenge to a new law that would allow the EU to cut funds to member countries that violate democratic rights and freedoms.

The final ruling by the Luxembourg-based European Court of Justice marks a milestone in the EU's feud with Poland and Hungary's populist rulers over undercutting the rule of law.

"The full court dismisses the action (by Hungary and Poland)," the court said.

The ruling opens the door for the European Commission to cut funding for member states flouting democratic standards

Both EU countries - which Brussels says are backsliding on rule of law - launched the legal challenge being heard by the European Court of Justice (ECJ), seeking the so-called "conditionality mechanism" to be invalidated.

But in December the court's adviser, the advocate general, concluded that the Polish-Hungarian challenge should be rejected, arguing that the conditionality mechanism was compatible with the EU's treaties.

The European Parliament, which approves the EU's multi-year budgets, has for months called for the commission to slash funds, stressing that the conditionality instrument has been available since the beginning of last year.

It has even launched its own legal action, accusing the commission of inaction.

But the EU executive, wary of being wrong-footed by court rulings and aware it needs a qualified majority of member states to approve the mechanism's use, has been determined to build a cast-iron case, step-by-step.

In November, it sent formal letters to Warsaw and Budapest setting out what it sees as the democratic shortfalls.

For Poland, it criticises judicial reforms it believes undermine judges' independence and a refusal to accept the primacy of EU law over Polish law.

For Hungary, it is about public procurement, conflict of interests and corruption.

We need your consent to load this rte-player contentWe use rte-player to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

That decision will next be debated in the European Parliament, where EU budget commissioner Johannes Hahn will stand in for commission chief Ursula von der Leyen, who pulled out to focus on the military crisis over Ukraine.

Poland's Constitutional Court is due to issue its own conclusions on the EU conditionality mechanism tomorrow.

The court is considered to be close to the ruling Law and Justice party that continues to defy Brussels.

It is expected that Poland and Hungary will throw up more legal challenges to try to overturn it.

The conditionality mechanism was created in 2020, after a summit at the height of the coronavirus pandemic that agreed common borrowing to build an €800bn pile of grants and loans for EU countries to recover.

Budget hawks, including Austria and the Netherlands, demanded the conditionality mechanism to put guard rails around the spending of taxpayers' money.