BRUSSELS (AP) — After months of acrimony, Greece clinched a preliminary bailout agreement with its European creditors on Monday that will, if implemented, secure the country's place in the euro and help it avoid financial collapse.
The terms of the deal, however, will be painful both for Greeks and their radical left-led government, which since its election in January had vowed to stand up to the creditors and reject the budget cuts they have been demanding.
Greece needs another bailout, its third in five years, to dig itself from under a mountain of debt and to get its economy back on its feet after a six-year depression. Following months of inconclusive talks, its economy is now teetering on the edge of collapse — banks have been shut for two weeks and daily business has almost ground to a halt amid cash withdrawal limits.
Before it can receive 85 billion euros ($95.07 billion) in loans and support for its banks to reopen, the Greek government will have to pass a raft of austerity measures that include sales tax increases and reforms to pensions and the labor market.
Greece will be on a tight timetable to implement its reforms — a reflection of how little its creditors trust the government to honor a deal. Greek Prime Minister Alexis Tsipras infuriated his European partners last month when he called for a popular vote against economic reforms the creditors has proposed.
The Greek people voted against those proposals, but now face even tougher measures. Syriza's Left Platform, a group of traditionalists in Tsipras's own party, swiftly denounced the agreement as the "worst deal possible ... that maintains the country's status: a debt colony under a German-run European Union."
Both sides in Brussels acknowledged the bitterness that marked their negotiations, which lasted nine hours past a Sunday midnight deadline.
"Trust needs to be rebuilt," said German Chancellor Angela Merkel, adding that with the deal, "Greece has a chance to return to the path of growth."
Stock markets rose sharply in Europe on news of a deal, as it averts the imminent danger of Greece falling out of the euro, an event that would create huge uncertainty European and global markets. The Stoxx 50 index was up 1.6 percent, though the euro was down 1 percent after spiking higher.
Experts, however, noted that Greece's problems are not over.
"This agreement pulls Greece back from the brink of economic chaos but remains far from ensuring its long-term economic viability within the euro zone," says Eswar Prasad, professor of trade policy at Cornell University. "Greece will face many challenges in delivering on the package of reforms it has promised... The Greek economy faces a wrenching period ahead as it copes with economic, social, and political instability resulting from tough fiscal discipline, sweeping reforms, and an eviscerated social safety net."
In a first step toward getting its bailout loans, the Greek government has to pass a set of measures into law by Wednesday.
They include an increase in the sales tax and reform of the pension system. In later weeks, Greece will have to open to competition industries that have long been protected, such as the energy sector. Labor laws will be made more flexible.
If it meets these requirements, Greece will get a three-year rescue program and a commitment to restructure its debt, which is unsustainably high at around 320 billion euros, or around 180 percent of annual GDP.
Tsipras argues that because of these concessions Monday's deal is, despite the tough austerity, actually better for Greece than the proposals Greeks voted down just a week ago.
He also said he had rejected a demand by some creditors to transfer Greek assets abroad as a form of collateral and to prevent the collapse of the banking sector.
"We managed to avoid the most extreme measures," Tsipras said.
Greeks seemed mainly relieved that the country was not facing a messy exit from the euro.
Kostas Lambos, a pensioner in Athens, said things would be "difficult in the beginning" but people had to understand the severity of the situation.
"This was a necessary step for the country to emerge from the dead ends that had been created in the last few years," he said.
Greece's banks, which have been shut for two weeks, were still closed on Monday and limits remained on cash withdrawals.
When they will be able to reopen will depend on when the European Central Bank decides to increase emergency credit to Greek banks. The ECB on Monday decided to not increase that credit. Analysts say it may be waiting for the Greek parliament to approve a first batch of reforms to secure the country's bailout.
French President Francois 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.
Losing Greece, he said, would have been akin to losing "the heart of our civilization."
Other European officials were less emotive.
"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. Dijsselbloem was expected to brief his fellow ministers Monday afternoon on the Greek deal, with Finland's finance minister saying the next move must come from Athens.
For formal bailout negotiations to start, said Alexander Stubb, "it is absolutely clear that the Greek parliament needs to approve this package."
The bill is likely to pass in parliament as it will have the backing of nearly all opposition parties. But Tsipras faces a tough battle to persuade his own radical left party that the deal was the best possible.
The creditors said they would help Greece in the short term with its debt repayments since a full bailout agreement was not imminent. Greece will need help making a 4.2 billion euro debt repayment on July 20. It is also in arrears on about 1.5 billion euros owed to the International Monetary Fund.
Greece has since 2010 received two bailouts, totaling 240 billion euros ($268 billion), in return for deep spending cuts, tax increases and reforms from successive governments. Although the country's budget deficit has fallen sharply, the public debt burden has increased as the economy has shrunk by a quarter.