BRUSSELS (AP) -- Greece reached a deal with its European creditors Monday, pledging stringent austerity to avoid an exit from the euro and the global financial chaos that could have followed.
The 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 surely collapse. The deal, 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 said it was a path well worth taking. He 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 financial collapse grew closer by the day.
A breakthrough came in a meeting between Tsipras, Hollande, Merkel and EU President Donald Tusk, after the threat of expulsion from the euro put intense pressure on Tsipras to swallow politically unpalatable austerity measures.
"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.
"The Greeks have to show they're credible, show that they mean it," said Jeroen Dijsselbloem, president of the eurogroup of eurozone finance ministers and a longtime critic of the Tsipras government.
A Cypriot official said the creditors would look into bridge financing for Greece later Monday, suggesting that the deal could pave the way for the European Central Bank to extend emergency liquidity assistance to Greek banks. Without it, 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.
Greece has received two previous bailouts, totaling 240 billion euros ($268 billion), in return for deep spending cuts, tax increases and reforms from successive governments. Although the country's annual budget deficit has come down dramatically, Greece's debt burden has increased as the economy has shrunk by a quarter.
The Greek government has made getting some form of debt relief a priority and hopes that a comprehensive solution will involve European creditors at least agreeing to delayed repayments or lower interest rates.
Greek debt stands at around 320 billion euros ($357 billion) — 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.