After gruelling 17-hour talks during which the future of the European project hung in the balance, leftist Greek Prime Minister Alexis Tsipras accepted terms set by his mistrustful partners.
The deal requires him to push through a raft of market-oriented laws by Wednesday as a sign of good faith, scrutinised by the International Monetary Fund (IMF) for complicance.
Only then will the 18 other eurozone leaders start negotiations over what Greece will get in return: a three-year bailout worth up to 86 billion euros (USD 96 billion), its third rescue programme in five years.
"All ready to go for ESM (eurozone bailout fund the European Stability Mechanism) programme for Greece with serious reforms and financial support."
Also Read
The last-ditch deal is aimed at keeping Greece's economy afloat amid fears its cash-starved banks were about to finally run dry and trigger its exit from the single currency.
"Grexit has gone," European Commission President Jean-Claude Juncker told AFP after the talks, ruling out the threat of a departure from the euro which could have potentially destablised the global economy.
A weary Tsipras insisted the deal was good for Greece, even though analysts say the terms are in some respects tougher than those Greek voters had rejected on his recommendation in a referendum just one week ago.
The deal, Tsipras argued, includes help to ease Greece's huge burden of debt and revive its crippled banking system.
"The great majority of Greek people will support this effort," he added.
European and Asian markets rose, although the euro ran out of steam as cautious dealers awaited clearer details of the accord.
But Tsipras now faces a tough task selling the deal to the Greek people, parliament and his radical Syriza party, which shot to power in January on the back of promises to end five years of bitter austerity under two previous bailouts.