European Union leaders have clinched a deal on a massive long-term budget and a fund to help the bloc’s ravaged economies recover from the impact of the coronavirus, but critics said the agreement lets Hungary and Poland off the hook for abusing the rule of law.

The 1.8 trillion euro ($A2.29 trillion) 2021-2027 budget and recovery package was meant to come into effect on January 1. Poland and Hungary agreed to the deal in July but later vetoed it, fearing the new “rule of law mechanism” might target them for possible breaches of Europe’s democratic standards.

“Now we can start with the implementation and build back our economies. Our landmark recovery package will drive forward our green and digital transitions,” EU Council President Charles Michel said in a tweet on Thursday after the deadlock was broken at an EU summit he chaired in Brussels.

The breakthrough came just days after it appeared that Poland and Hungary’s 25 EU partners might go it alone and create a new recovery package without them, potentially depriving them of billions of euros worth of assistance.

Hungarian Prime Minister Viktor Orban was in a celebratory mood, saying on Facebook that “common sense has won”.

Under the compromise, the European Commission will draw up guidelines for using the new rule of law mechanism and what might trigger it, with Europe’s top court weighing in on their validity.

While acknowledging governments are in dire need of coronavirus funds, some warned of the dangers of delaying action yet again against Hungary and Poland, whose nationalist governments have been accused of undermining judicial independence and media freedoms.