By JOHN-THOR DAHLBURG and PAN PYLAS
BRUSSELS (AP) - After grueling, often angry negotiations that tested the limits of European unity, Greece on Monday won a preliminary deal that averts financial catastrophe but also guarantees years more of hardship and sacrifice for its people.
Prime Minister Alexis Tsipras flew home to sell the plan to skeptical lawmakers and political allies, some of whom accused him of putting Greece at the mercy of its foreign creditors.
To close the deal with its partners in the euro currency, Greece had to consent to a raft of austerity measures, including sales tax hikes and reforms to pensions and the labor market.
Enough of Greece's 18 eurozone partners were openly suspicious of its sincerity that they demanded, and got, Tsipras's commitment to accept close international oversight.
For the Greek leader and his radical left-wing government, which since election in January had vowed to stand up to the creditors, the payoff of the marathon negotiations in Brussels was clear: about 85 billion euros ($95.07 billion) in loans and financial support over three years, preserving Greek membership in the euro, and helping their country stave off financial collapse.
"We managed to avoid the most extreme measures," Tsipras said after the summit.
Tsipras said he successfully got creditors to drop a demand that Greek assets be transferred abroad as a form of collateral, and that the deal reached was less harsh than proposals from creditors his country's voters rejected a week ago.
But in many cases, ordinary Greeks now face tougher measures than those they voted down in a nationwide referendum. Syriza's Left Platform, a group of traditionalists in Tsipras's own party, swiftly denounced the agreement he had reached with fellow eurozone leaders as the "worst deal possible ... that maintains the country's status: a debt colony under a German-run European Union."
After flying home to Athens, Tsipras went to the prime minister's office to meet with Finance Minister Euclid Tsakalotos and other top party officials. To abide by the agreement and ensure that negotiations on a new infusion of financial aid for Greece can start in earnest, Tsipras must push several unpalatable measures through Parliament by Wednesday.
Passage appears assured, though he faces an uphill battle to persuade members of his own party, as well as his governing coalition partner, a small right-wing party, to back the deal.
Greece needs another bailout, its third in five years, to dig itself from under a mountain of debt and get its economy back on its feet after a six-year depression. Following months of talks with its eurozone partners and other international creditors, its economy is teetering on the brink of collapse - banks have been shut for two weeks and daily business has almost ground to a halt.
Greece will now be on a tight timetable to implement the new reforms - another reflection of how little its creditors trust the government to honor a deal. 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 Monday deal, "Greece has a chance to return to the path of growth."
"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.
French President Francois Hollande hailed the agreement, saying that losing Greece from the eurozone would have been akin to losing "the heart of our civilization."
But experts noted that even with the deal, 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 eurozone," 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."
Greece's banks, which have been shut for two weeks, were still closed Monday and limits remained on cash withdrawals. When they reopen will depend on the European Central Bank's decision to allow them to draw on more emergency credit. It may do so only after the first reforms are passed by parliament in Greece.
In weeks to come, Greece will have to make further changes to its economy, such as open to competition industries that have long been protected, such as the energy sector.
If it meets all of the requirements spelled out in Monday's agreement, 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.
Ordinary Greeks seemed relieved that their 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.
Since 2010, Greece has received two bailouts, totaling 240 billion euros ($268 billion), in return for deep spending cuts, tax increases and reforms agreed to by successive Greek governments. Although the country's budget deficit has fallen sharply, the public debt burden has increased as the economy has shrunk by a quarter.
Its creditors said they would help Greece in the short term to repay its debts since a full agreement on the third bailout still lies ahead. 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.
Elena Becatoros in Athens, Greece; Raf Casert and Menelaos Hadjicostis in Brussels and Paul Wiseman in Washington contributed to this story.