Greece appeared to reach a deal with its European creditors on Monday, pledging stringent austerity to avoid an exit — or "Grexit" — from the euro and the global financial chaos that could have followed.
"One can say that we have 'agreekment'," European Council President Donald Tusk said in a statement, following negotiations that lasted 17 hours, continuing through Sunday night.
"There are strict conditions to be met," Tusk continued. "The approval of several national parliaments, including the Greek parliament, is now needed for negotiations on an ESM [European Stability Mechanism] program to formally begin.
"Nevertheless, the decision gives Greece a chance to get back on track with the support of European partners. It also avoids the social, economic, and political consequences that a negative outcome would have brought. I welcome the progress and the constructive position of Greece that helps to bring back trust among euro zone partners."
The new deal calls for Greeks, already reeling from harsh measures and economic decline, to cut back even further in exchange for more loans without which its financial system would likely collapse. The agreement, which still needs approval from Greece's parliament, will be the country's third bailout in five years.
To get to a deal, Greek Prime Minister Alexis Tsipras had to overcome the fundamental mistrust of many of his allies among the 18 other countries that use the euro, known as the Eurozone. Just a week earlier, at his urging, Greeks had voted in a referendum to reject many of the measures he agreed to Monday, and the deal forced him to renege on many of his election promises.
"We managed to avoid the most extreme measures," Tsipras said. "Greece will fight to return to growth and to reclaim its lost sovereignty."
Both sides acknowledged the bitter disputes that kept the leaders at odds for months, and kept them negotiating nine hours past a Sunday midnight deadline. German Chancellor Angela Merkel said that along with the deal, "trust needs to be rebuilt."
"Greece has a chance to return to the path of growth," she said, but "it will be a long road."
French President Francois Hollande — who hugged Tsipras as the two leaders left the meeting — said this was a path well worth taking. Hollande said the Greek parliament would convene within hours to adopt the reforms called for in the plan, and he celebrated Greece's continued membership in the euro. For the Eurozone to have lost Greece, Hollande said, would have been to lose "the heart of our civilization."
Tsipras had been holding out for a better deal to sell to his reluctant legislature in Athens this week, even as the possibility of financial collapse grew closer by the day.
"We took the responsibility of the decision to be able to avert the harshest outcome," Tsipras said. "We managed to avert the demand to transfer Greek assets abroad, to avert the collapse of the banking system."
The deal includes commitments from Tsipras to push a drastic austerity program including pension, market, and privatization reforms through parliament as soon as possible. In return, the 18 other Eurozone leaders committed to start talks on a new bailout program.
A Cypriot official said the creditors would look into bridge financing for Greece later Monday, without which, they risk running out of cash this week. The official spoke only on condition of anonymity because he was not authorized to discuss the deal publicly.
If the talks had failed, Greece could have faced bankruptcy and a possible exit from the euro, the European single currency that the country has been a part of since 2002. No country has ever left the joint currency, which launched in 1999, and there is no mechanism in place for one to do so.
Greece had requested a three-year, 53.5 billion-euro ($59.5 billion) financial package, but that number grew larger by the tens of billions as the negotiations dragged on and the leaders calculated how much Greece will need to stay solvent.
The leaders of the Eurozone estimated the needs of Greece to stand somewhere around 85 billion euros.
Greek debt stands at around 320 billion euros — a staggering 180 percent or so of the country's annual gross domestic product. Few economists think that debt will ever be fully repaid. Last week, the International Monetary Fund said Greece's debt will need to be restructured.
Speaking before going in to the meeting, Tsipras had assured reporters: "We can reach an agreement tonight if both parties want it."
The Associated Press contributed to this report.