Prime Minister Alexis Tsipras flew home to sell the bailout plan to skeptical lawmakers and political allies, some of whom accused him of selling Greece out. Panos Kammenos, leader of the junior partner in Tsipras' coalition government, denounced the deal as a German-led "coup."
"This deal introduced many new issues ... we cannot agree with it," he said after meeting with Tsipras.
Other Greeks rallied Monday night before Parliament in Athens, urging lawmakers to reject the new demands.
To close the deal with his partners in the euro currency, Tsipras had to consent to a raft of austerity measures, including sales tax hikes and pension and labour reforms — measures he had campaigned vociferously against over the last five years of Greece's financial crisis.
Since his election in January, the youthful Tsipras has faced intense pressure to backpedal on many of his promises to Greece's exhausted electorate. Finally, faced Sunday by the leaders of the 18 other nations that share the euro and the knowledge that Greek banks were just days from running out of money, the moment came when he couldn't resist any more.
A series of supposed red lines vanished, including objections to tight international oversight of Greece's economy, continued involvement by the International Monetary Fund in Greece's bailout program and cuts to pensions.
The result of marathon negotiations emerged Monday: about 85 billion euros ($95.1 billion) in loans and financial support for Greece over three years that will preserve its membership in the euro, shore up its banks and allow a modicum of stability to return to the battered Greek economy.
Creditors have also dangled the carrot of a possible future debt restructuring in the event of a smooth bailout.
"We managed to avoid the most extreme measures," Tsipras said.
But in many cases, ordinary Greeks now face tougher measures than those they voted down in a nationwide referendum a little over a week ago.
Syriza's Left Platform, a group of traditionalists in Tsipras' own party, swiftly denounced the agreement as the "worst deal possible ... (one) that maintains the country's status: a debt colony under a German-run European Union."
Financial experts themselves were divided over the result.
"It was the best deal the Greeks could get," says Jacob Kirkegaard, a senior fellow at the Peterson Institute for International Economics. "They did not do too badly given the terrible, terrible, disastrous starting point the current government put them in."
But Ashoka Mody, visiting professor of international finance at Princeton University, says the deal just repeats policies that have already failed.
"The economics of this program have been set up for failure," he told The Associated Press. "In three years, if this program is implemented, the Greek economy will be 10 per cent smaller than it was and the debt burden will be higher."
In many ways, Tsipras' hard work begins now. As part of the deal, his government has to get the Greek Parliament to back a series of economic measures by Wednesday that creditors are demanding. And in the weeks to come, Greece will have to make further changes to its economy, such as opening to competition industries like energy that have long been protected.
"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."
Passage of the new measures appears assured, since Greece's opposition parties have pledged to support Tsipras' deal. But dissent within the ruling Syriza party is threatening his coalition, raising the prospect of some sort of national unity government or an early election later this year.
Greece needs another bailout, its third in five years, to cope with its mountain of debt and get its economy back on track after a six-year retreat that evokes memories of the 1930s' Great Depression in the U.S. The Greek economy has been pushed to the brink of collapse — banks have been shut down for two weeks, capital controls limit withdrawals to a paltry 60 euros ($67) per day and normal business has almost ground to a halt.
When the Greek banks eventually reopen, they will most likely have to depend on more emergency credit from the European Central Bank.
Indications are that the ECB won't sanction further help until the Greek parliament passes the first set of creditor demands on Wednesday. And even if the ECB does start raising its emergency liquidity allowance, Greek capital controls are expected to remain for many months more.
"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, a professor of trade policy at Cornell University.
Greece has other financing needs beyond its banks. On July 20, it has to make a 4.2 billion-euro ($4.6 billion) debt repayment to the ECB. It's also in arrears on about 1.5 billion euros owed to the IMF. Since its bailout program is not going to be in place by then — Jeroen Dijsselbloem, the eurozone's top official, estimated that would take about four weeks — Greece will need some further help.
Dijsselbloem said finance ministers were trying to figure out how to get Athens some bridge financing but warned they had "yet to find the golden key to solve this issue."
If Greece meets all of the requirements spelled out in Monday's agreement, the country will get a three-year rescue program and the commitment to restructure its debt, which is unsustainably high at around 320 billion euros ($352 billion), or around 180 per cent of its annual GDP.
Since 2010, Greece has received two bailouts totalling 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, its public debt burden has increased as the Greek economy has shrunk by a quarter.
Ordinary Greeks seemed relieved their country was not facing a chaotic exit from the euro.
Kostas Lambos, a retiree 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.
Elena Becatoros and Derek Gatopoulos in Athens, Greece; Raf Casert and Menelaos Hadjicostis in Brussels and Paul Wiseman in Washington contributed to this story.
Also on HuffPost