European Union leaders have agreed to set a more ambitious target of cutting greenhouse gas emissions by 55% by 2030.
"Europe is the leader in the fight against climate change," European Council president and summit host Charles Michel declared on Twitter.
European Commission chief Ursula von der Leyen said: "Europe will reduce emissions by at least 55 percent by 2030. It puts us on a clear path towards climate neutrality in 2050."
The leaders had debated climate change measures for eight long hours, dragging a summit that started yesterday through into this morning.
Poland, backed by some other coal-dependent central European countries, had been holding out for guarantees on funding to pay for a clean energy transition.
The debate pushed talks on Brexit down the agenda, and the division took some of the shine off the earlier announcement that the leaders had agreed the EU long-term budget.
However as the sun came up over Brussels, the leaders announced their climate breakthrough.
The €1.8 trillion budget and coronavirus recovery package had been blocked by Hungary and Poland over an attempt to link the disbursement of funds to respect for the rule of law.
The stand-off risked delaying the recovery fund well into next year, just as a second wave of the coronavirus pandemic was punishing the European economy, but the leaders came to a compromise that allowed the package to go through.
Polish leader Mateusz Morawiecki explained that under the deal the rule of law mechanism would be limited to ensure that EU funds are spent correctly according to precise criteria and not touch on social issues such as abortion, LGBT rights or migration policy.
Both Poland and Hungary are major recipients of EU budget cash, and the new mechanism is seen as a way by critics to slow a steady slide into authoritarianism in those countries.
Both governments have been accused by Brussels of rolling back democratic freedoms, notably judicial independence in Poland and press and civil society freedoms in Hungary.
This morning Justice Minister Judit Varga said Hungary will launch a case to annul the rule-of-law conditionality regulation in the bloc's top court.
To delay the application of the new regulation on the rule of law, Poland and Hungary can ask the EU's top court to check if it is in line with EU treaties, which could take two years.
"No one should have any doubts the Hungarian government will attack this (in EU's court) as we believe there are rule of law problems with the text of the declaration itself, and I am sure the EU court will remedy these," Ms Varga told state radio.