European Union leaders reached a deal on a massive stimulus plan for their coronavirus-blighted economies at a pre-dawn meeting on Tuesday after a fractious summit that went through the night and into its fifth day.
Summit chairman Charles Michel tweeted "Deal" shortly after the 27 leaders reached agreement at a 5.15am (0315 GMT) plenary session.
While another official present at the summit said: "Conclusions adopted!".
Officials said the deal, which came after Michel presented compromises on a 750 billion euro recovery fund, is critical to dispel doubts about the bloc's very future.
The EU was slow to coordinate its initial response to the Covid-19 pandemic and, already weakened by Britain's departure from the bloc, a united front on economic aid would demonstrate that it can step up to a crisis and stay united.
"It has been a long summit and a challenging summit but the prize is worth negotiating for," Irish Prime Minister Micheal Martin said as the Brussels summit approached the record length set at a 2000 meeting in the French city of Nice of almost five full days.
European nations have done a better job of containing the coronavirus than the United States after a devastating early few months that hit Italy and Spain particularly hard, collaborating on medical, travel and economic fronts.
The European Central Bank has pumped unparalleled money into economies to keep them going, while capitals hammer out their recovery fund.
Diplomats said the leaders appeared to put aside the rancour that stood in the way of a compromise over hours of haggling through the weekend.
'Stingy and egotistical'
Emotions had ran high at a dinner on Sunday as a group of fiscally frugal northern nations led by the Netherlands stood their ground on the level of free grants within a proposed special recovery fund of 750 billion euros overall.
French President Emmanuel Macron lost patience in the early hours of Monday, banging his fist on the table in frustration at "sterile blockages" by the "frugals", two diplomats said.
Polish Prime Minister Mateusz Morawiecki also railed against the "frugals", branding them "a group of stingy, egotistic states" that looked at things through the prism of their own interests.
Poland would be a top beneficiary of the recovery package, receiving tens of billions of euros in grants and cheap loans, along with high-debt Mediterranean-rim countries that have taken the brunt of the pandemic in Europe.
But the rhetorical skirmishing faded on Monday, and the leaders homed in on an agreement on the stimulus package and, linked to it, the EU's 2021-2027 common budget of around 1.1 trillion euros.
Hopes for a deal to help address Europe's deepest recession since World War Two sent Italy's borrowing costs to their lowest since early March and pushed the euro to a 19-week high.
Michel proposed that within the 750 billion euro recovery fund, 390 billion should be non-repayable grants, down from 500 billion originally proposed, and the rest in repayable loans.
The Netherlands had pushed for a veto on aid for countries that backslide on economic reform, but diplomats said it was now willing to back a "stop-the-clock" mechanism by which member states could put a brake on disbursements for three months and have them reviewed.
Disbursements will also be linked to governments observing the rule of law. Hungary, backed by eurosceptic ally Poland, had threatened to veto the package if funds were made conditional on upholding democracy, but diplomats said a way forward on that was found.