After almost five days of fraught discussions, European leaders have agreed to create a €750 billion ($858 billion) recovery fund to rebuild EU economies ravaged by the coronavirus crisis. The European Commission will borrow the money on financial markets and distribute just under half of it — €390 billion euros ($446 billion) — as grants to the hardest hit EU states, with the rest provided as loans. Leaders also agreed a new EU budget of nearly €1.1 trillion ($1.3 trillion) for 2021-2027, creating combined spending power of about €1.8 trillion ($2 trillion). “It is an ambitious and comprehensive package combining the classical [budget] with an extraordinary recovery effort destined to tackle the effects of an unprecedented crisis in the best interest of the EU,” the EU leaders said in a joint declaration. The deal focuses on providing funding across three pillars: helping businesses rebound from the pandemic, rolling out new measures to reform economies over the long haul, and investing to help protect against “future crises.” It came after days of deadlock and fractious talks that were described as some of the most bitterly divided in years. “We did it! Europe is strong. Europe is united,” European Council President Charles Michel said at a press conference Tuesday. “This is a good deal, this is a strong deal, and most importantly, this is the right deal for Europe right now.” Michel said it was the first time that members of the European Union were “jointly enforcing our economies against the crisis.” The European Union is battling a savage recession triggered by the pandemic, and the hardest-hit countries such as Italy and Spain urgently need fresh economic relief. The European Commission said earlier this month that it expects the EU economy to shrink 8.3% in 2020, considerably worse than the 7.4% slump predicted two months ago. Before Tuesday, agreement had been thwarted by deep divisions over the overall size of the recovery fund, the mix of grants and loans, and the conditions that should be attached to the relief. Details of the deal There had been bitter rows over some of the terms of the deal during the last few days. The agreement came just hours after Michel had presented a new proposal to political leaders on Monday. The European Commission’s original proposal was to distribute €500 billion ($573 billion) via grants, while €250 billion ($286 billion) would have been offered as loans. But the volume of grants had been vehemently contested during the summit. The so-called “Frugal Four” countries — Netherlands, Denmark, Austria and Sweden — were worried it would burden their countries with debt to fund the spending of other governments. Using grants would have required net contributors to the EU budget, including the “Frugal Four,” to pay in more. Relying on loans, meanwhile, would mean saddling highly-indebted countries such as Italy with even more liabilities. The new agreement means the European Union will become a major borrower in global financial markets for the first time. It plans to repay the money by 2058. To help do that, it will look for fresh ways to raise funds. The Commission said in the text of the deal that it would propose a “digital levy” for tech companies, and consider a new tax on financial transactions. It also said it would consider updating an existing emissions trading program, which caps the amount of greenhouse gases companies are allowed to emit without facing fines. It could extend the restrictions to the aviation and maritime industries, according to the Commission. How it came to pass The meeting of the EU top brass was the first major in-person gathering of world leaders since the pandemic started — and the negotiations ran for four days and nights. It was “more than 90 hours, but it was worth it,” European Commission President Ursula von der Leyen told reporters Tuesday. Failure to reach an agreement would have risked a “two-speed” economic recovery, with wealthier northern European states bouncing back faster than struggling Italy and Spain. That in turn would have placed further enormous strain on the ties that keep the EU together. French President Emmanuel Macron hailed the signing of the deal as a “historic day for Europe.” “Think of the distance that we have covered. Ever since February, we have not been able to come to some type of agreement,” he said. “Now we have the [budget], we have the recovery fund and this amounts to almost 2% of the EU GDP.” Macron hailed the leaders’ efforts as helping “to almost double the EU budget for the next years to come,” while German Chancellor Angela Merkel declared that “we have laid out the financial foundations for the European Union for the next seven years.” Holger Schmieding, chief economist at Berenberg, called the deal “a big step forward for Europe.” “With the biggest ever effort of cross border solidarity, the EU is sending a strong signal of internal cohesion,” he wrote in a note Tuesday. “Near term, the confidence effect can matter even more than the money itself.” — Chris Liakos, Julia Horowitz and Mark Thompson contributed to this report.