After some 17 hours of summit talks eurozone leaders announced a new deal to rescue Greece - a third bailout.
There are still significant hurdles to clear, however. And after months of argument and delay between the Greek government and the lenders, the eurozone wants the new sense of urgency to be maintained.
The risk of Grexit - a Greek exit from the euro - has not gone away. So what are the key points of the deal? (You can read the full text of the agreement here.)
- The Greek parliament must immediately adopt laws to reform key parts of its economy - by Wednesday. The reforms include: streamlining the pension system and boosting tax revenue - especially from VAT
- A commitment to liberalise the labour market, privatise the electricity network and extend shop opening hours
- The eurozone agrees in principle to start negotiations on a loan package for Greece worth €82bn-€86bn (£59bn-£62bn; $91bn-$96bn) spread over three years
- The loan will come mainly from the European Stability Mechanism (ESM) - the eurozone bailout fund. But the International Monetary Fund will also be asked to make a contribution from March 2016
- A new trust fund will be set up, managed by Greece, with €50bn of Greek assets. It is a mechanism for paying off part of the total ESM loan. Half of the €50bn will be used to fund recapitalisation of Greek banks, the other half will go towards reducing Greece's debt mountain - by privatising assets - and investing in Greece.
- Greece will get short-term bridge financing to avoid bankruptcy - separate from the ESM. The amount is estimated to be €7bn by next Monday and another €5bn by mid-August
- Out of the total ESM loan about €10bn will be used immediately to recapitalise Greek banks - but the banks may need €25bn in total
- The European Central Bank, eurozone finance ministers and the IMF will tightly monitor Greek compliance with the bailout conditions
- Negotiations on the ESM bailout will begin only after the plan is approved by the parliaments of Finland, Germany and Greece
- The eurozone is ready if necessary to extend the repayment period of Greek debt (by debt rescheduling), but debt will not be written off (so no "haircut")
- The European Commission will try to mobilise €35bn - outside the ESM loan - to help Greece with growth and job creation.
What is the ESM?
- Eurozone's only permanent bailout fund - financed by all 19 member states
- Launched in Oct 2012, total lending capacity is €500bn
- Only lends if borrowing country agrees to fulfil strict economic conditions
- ESM made loans to rescue banks in Spain (€41.3bn) and Cyprus (€9bn)
- Germany is biggest ESM contributor (€190bn)
- Like IMF loans, ESM loans don't add to lenders' national debt
- ESM bailout takes at least three weeks to organise