Eurozone leaders have agreed an €86bn bailout that should see Greece remain in the euro - but the crisis appears to be far from over.
The plan, agreed after seventeen hours of talks, means Greek Prime Minister Alexis Tsipras will have to abandon promises to end austerity.
The deal appears to impose even more stringent measures on the country than the bailout offered prior to Mr Tsipras leaving talks and calling a referendum two weeks ago.
These include unpopular reforms of pensions and value added tax, spending cuts and tax hikes.
European Commission President Jean-Claude Juncker insisted the country had not been "humiliated".
"In this compromise, there are no winners and no losers," Mr Juncker said.
"I don't think the Greek people have been humiliated, nor that the other Europeans have lost face. It is a typical European arrangement.
"There will not be a Grexit."
The country will have to identify €50bn of publicly owned assets, separate to the €86bn bailout, to be sold off to contribute to the rescue.
The Greek parliament must enact all of the above by Wednesday night for the bailout over three years to go through.
Mr Tsipras said the negotiations had been a "tough battle" but insisted he had managed to avert "the plan of a financial collapse and banking system collapse".
Taoiseach Enda Kenny has welcomed the deal, but called the process "bruising".
This afternoon the European Central Bank (ECB) chose to maintain its cash lifeline for Greek banks - but will not increase the money available to them.
The bank says it will maintain its cap of €89bn in emergency loans.
The move means Greece's banks - which are already running low on cash supplies - are likely to remain shut for another two days at least, with withdrawals still limited at €60 per day.
The matter is due to be reconsidered on Thursday, by which time the Greek government is due to have passed reforms to its VAT and pensions laws.
Gerry Rice, director of communications at the International Monetary Fund (IMF), has said, "following on the managing director's participation in the discussions on Greece held in Brussels over the weekend, she briefed the IMF's Executive Board on the outcome as reflected in the Eurozone leaders' statement published earlier today.
"The IMF stands ready to work with the Greek authorities and the European partners to help move this important effort forward," he added.
The tough conditions imposed by the international lenders still have the potential to bring down the deal and the Greek government.
Many Greeks reacted furiously to the agreement.
Even before details of the deal were made public, labour minister Panos Skourletis said the terms were unviable and would lead to a new government.
Senior Syriza MP George Katrougalos says the Prime Minister secured the best deal he could:
There remains a lack of trust on the creditor side, with German Chancellor Angela Merkel among those saying the relationship had to be "rebuilt" following months of tortuous talks.
She added that future funding was conditional on the continued involvement of the International Monetary Fund - a scenario Greece had tried to block.
It is thought only France and Italy worked to try to soften the terms being imposed on Greece.
Financial markets reacted positively to the deal, with Germany's DAX 1.2% higher in early deals while the CAC-40 in France rose 1.6% as investors saw it as a positive sign that a Greek exit from the eurozone had been averted.
However, the euro remained sluggish against a strong dollar.
Newstalk.com's Shona Murray was in Brussels - and says the deal followed tension-filled debate.