Three months after it was first proposed and needing five straight days of marathon meetings to iron out the details, the much-delayed coronavirus recovery package was finally agreed to by the fractious 27 member states of the European Union on Tuesday.

The EU's historic coronavirus recovery package is an unprecedented $2 trillion (€1.8 trillion) aid and budget deal. The package is aimed at helping hard-hit member states recover from the crippling economic paralysis triggered by the COVID-19 pandemic, which wrought its worst havoc on the bloc from February to May.

The package includes an $858 billion (€750 billion) fund to be set aside as loans and grants. Its emergency fund provides $446 billion (€390 billion) in grants and $412 billion (€360 billion) in low-interest loans.

Almost a third of the funds are earmarked for fighting climate change. Taken together with the EU's next seven-year $1.24 trillion (€1 trillion) budget,  the entire package will constitute the biggest green stimulus package in history.

European Council (EC) President Charles Michel tweeted a brief message minutes after EU leaders approved the plan: "Deal!"

"We did it," he later said at a press briefing. "Europe is strong, Europe is united. This is a good deal, this is a strong deal and most importantly this is the right deal for Europe right now. I believe this agreement will be seen as a pivotal moment for Europe's journey."

The European Parliament will still have to agree to the package. The investment, however, will do nothing to forestall a projected 8.3%  contraction in the EU's combined GDP for this year.

The package includes the biggest-ever joint borrowing by the EU from the European Central Bank (ECB). The bloc also plans to lend tens of billions of euros to member states heavily hit by the pandemic: Spain, Italy and Greece.

Spanish Prime Minister Pedro Sanchez said the plan will provide $160 billion (€140 billion) to Spain over the next six years. 

Italy will receive $239 billion (€209 billion). Italian Prime Minister Giuseppe Conte said Italy is satisfied with the package. The amount includes $93 billion (€81 billion) in grants and $145 billion (€127 billion) in loans.

Greece will also receive $82 billion (€72 billion). Prime Minister Kyriakos Mitsotakis called the package a national success.

European Commission (EC) President Ursula von der Leyen said Europe as a whole has now a big chance to come out stronger from the crisis.

"Today we have taken a historic step that we can all be proud of," said von der Leyen. "Tonight is a big step toward recovery."

She thanked German Chancellor Angela Merkel for helping steer the testy negotiations towards a European solution.

For her part, Merkel described the deal as an important signal. She said she was very relieved EU leaders were able to cooperate. She pointed out it was good "we pulled ourselves together in the end."

French President Emmanuel Macron agreed with Merkel and called it a "historic day for Europe."

"There is no such thing as a perfect world, but we have made progress," according to Macron.