Eurozone finance ministers negotiated late into the night to bring an end to an eight-year bailout for Greece. Debt relief and a big cash payout will form part of a broad exit deal.
Finance ministers from the eurozone's 19 members agreed on Friday on the conditions to end Greece's lengthy bailout program.
Ministers hope the hard-fought deal will bring an end to eight years of austerity and bailouts for Athens.
Details of the deal
Last minute resistance from Germany reportedly led to talks stretching into the early hours of Friday.
European Economy Commissioner Pierre Moscovici said after the deal was etched: "I'd like to explain the significance of what we're witnessing this evening: this is not something routine, it's exceptional and it's historic." "The Greek crisis ends here tonight."
Eurogroup President Mario Centeno said: "This is it. We have managed to deliver a soft landing of this long and difficult adjustment."
Greek Finance Minister Euclid Tsakalotos said: "It took a bit longer than we expected, but ended in a very good way ... To make this worthwhile we have to make sure that the Greek people see concrete results ... they need to feel the change in their own pockets."
Sustainable debt: The package will end Greece's third bailout program since 2010 and will try to keep the country's debt at a sustainable level. The deal aims to ensure Athens does not backslide on its reforms as it returns to the capital markets.
Greece's history of bailouts: Greece has received €275 billion from international creditors over the past eight years in three separate bailouts after suffering immensely in the financial crisis. Its financial woes saw Greece almost get kicked out of the eurogroup as it cleaved a rift in both the eurozone and the wider European Union.
The third bailout: The latest bailout was granted in 2015, with European creditors granting Athens €86 billion euros under the European Stability Mechanism in return for more than 450 reforms. The reforms included modernizing its fiscal administration and restoring financial stability.
Hoping for investor confidence: The 2015 bailout is due to expire on August 20. After that, Athens is hoping to raise money on markets, which will require the confidence of investors.
aw/sms (AP, AFP, dpa)