Greece has agreed to tough reforms after marathon talks with Eurozone leaders in return for a three-year bailout worth up to 86 billion euros ($129 billion).
Photo: Greece's PM Alexis Tsipras and finance minister Euclid Tsakalotos leave the Eurozone leaders summit in Brussels. (Reuters: Eric Vidal)
The terms imposed by international lenders, led by Germany in 17 hours of talks, obliged prime minister Alexis Tsipras to abandon promises of ending austerity and could fracture his government and cause an outcry in Greece.
To get the accord through parliament by the deadline on Wednesday, Mr Tsipras will have to rely on votes from pro-European opposition parties, raising big question marks over the future of his government and opening the prospect of snap elections.
As part of the deal, Eurozone finance ministers will discuss how to keep Greece financed during the time it will need to gain parliamentary approval, but none of the options appear easy, officials said.
Athens must meet a tight timetable for enacting unpopular reforms of value added tax, pensions, budget cuts, bankruptcy rules and an EU banking law that could be used to make big depositors take losses.
This will be Greece's third rescue program in five years, which will be funded by the European Stability Mechanism, the EU's bailout fund.
Mr Tsipras emerged from the talks saying his government "faced difficult decisions".
"We took the responsibility for the decision to avert the most extreme plans by conservative circles in Europe," he said.
"We averted a plan of a financial choking and banking collapse."
He said a growth package of 35 billion euros and debt restructuring "will make Grexit a thing of the past".
In his first interview since resigning as Greek finance minister, Yanis Varoufakis took aim at Greece's creditors, revealed the extent of the country's preparations to leave the euro and warned of the rise of the far right.
European shares surged on the news of the deal which prevented Greece from crashing out of the European single currency.
"Clearly the Europe of austerity has won," Greece's reform minister George Katrougalos told BBC radio.
"Either we are going to accept these draconian measures or it is the sudden death of our economy through the continuation of the closure of the banks.
"So it is an agreement that is practically forced upon us."
European Council president Donald Tusk said terms of the deal meant strict conditions needed to be met.
"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."
Long and difficult road ahead: Merkel
"The road will be long, and judging by the negotiations tonight, difficult," German chancellor Angela Merkel said.
Asked whether the tough conditions imposed on Greece were not similar to the 1919 Versailles Treaty that forced crushing reparations on a defeated Germany after World War I, Ms Merkel said: "I won't take part in historical comparisons, especially when I didn't make them myself."
US treasury secretary Jack Lew said the deal was good for the global economy.
"Today's agreement between Greece and its creditors is an important step forward," he said in a statement.
Greece applied last week for a third program from the Eurozone's bailout fund after its previous bailout expired on June 30, leaving it without international financial assistance for the first time in years.
Greek banks have been closed for nearly two weeks and there were fears they were about to run dry due to a lack of extra funding by the European Central Bank.
This would mean Athens would have had to print its own currency and effectively leave the euro.
But Euro group head Jeroen Dijsselbloem said Eurozone finance ministers had not yet been able to find a solution to provide short-term funding.
"This is very complex, we looked at a number of possibilities," he said.
"We have not yet found the 'golden key' to solve this issue."
The Greek finance ministry confirmed banks would remain closed until at least July 15 inclusive.
Former finance minister likens deal to 'new Versailles Treaty'
In his first interview since resigning earlier this month, former Greek finance minister Yanis Varoufakis described the bailout deal agreed to by Mr Tsipras as "a new Versailles Treaty".
"This is the politics of humiliation," he told Radio National's Late Night Live.
"The troika have made sure that they will make him eat every single word that he uttered in criticism of the troika over the last five years. Not just these six months we've been in government, but in the years prior to that.
"This has nothing to do with economics. It has nothing to do with putting Greece on the way to recovery.
"This is a new Versailles Treaty that is haunting Europe again, and the prime minister knows it. He knows that he's damned if he does and he's damned if he doesn't."
Mr Varoufakis rejected the deal in the strongest possible terms, comparing it to the 1967 coup d'état that installed a military dictatorship in the Mediterranean nation.
"In the coup d'état the choice of weapon used in order to bring down democracy then was the tanks. Well, this time it was the banks. The banks were used by foreign powers to take over the government," he said.
"The difference is that this time they're taking over all public property."
Mr Varoufakis suggested that Mr Tsipras may call a snap election rather than bring the deal before the Greek parliament, saying he would be "very surprised" if Mr Tsipras wanted to stay on as prime minister.
He insisted, however, that he and Mr Tsipras remain on good terms, and that he has kept a low profile over the last week in order to support Mr Tsipras and his successor in the finance ministry, Euclid Tsakolotos.
"I jumped more than I was pushed," he said, describing his resignation in the immediate aftermath of the 'no' vote in the July 6 referendum on bailout terms similar to those accepted on Monday.
Syriza member of the European parliament Stelios Kouloglou said Mr Tsipras was blackmailed into accepting the deal with Eurozone leaders.
"The style was very colonial, like take it or leave it, we are the bosses," he told the ABC's The World program.
"You cannot find one serious economist in the world who will tell you that after six years of recession, you need more austerity."