Here is an uncomfortable truth: The deal Greece ended up with is much harsher than the one it had been rejecting for months.
The Greek government has caved to the pressure of its creditors. It signed up for tough economic reforms in exchange for a new bailout worth between 82 and 86 billion euros, or as much as $96 billion.
But not much has changed for the Greeks. The banks are still closed and will remain shut until at least Wednesday. The country is still on the brink of economic collapse. Its future within the eurozone remains uncertain.
And a lot of work has to be done before it gets any real rescue money.
What are the next political steps?
The all-night summit ended with an agreement, but more approvals are needed. The deal is the first step in a process that will likely take weeks.
First there are some key political decisions to be made across Europe.
Greece has to swiftly pass a series of new laws. Prime Minister Alexis Tsipras has until Wednesday to convince Parliament to pass the first few, including pension cuts and higher taxes.
Assuming that happens, Greek lawmakers have another week, until July 22, to enact another batch of economic changes. These include adopting European Union rules on how to manage banks in crisis, and do a major overhaul to make Greece's civil courts faster and more efficient.
Meanwhile, the deal must be endorsed by national parliaments in several other eurozone countries, including Germany, Finland and Portugal.
When will Greece start getting bailout money?
Greece is so close to collapse it needs some financial help ASAP.
The eurozone finance ministers are already back at work to figure out a "bridge financing" plan -- cash Greece needs to make immediate payments. Greece missed making a 456 million euro payment to the IMF Monday, bringing the total it owes the IMF to 2 billion euros.
The document agreed to Monday morning estimates Greece needs 7 billion euros by next Monday (July 20) and another 5 billion euros in August. That money would come from the European bailout fund.
Also, a decision has to be made when to reopen the banks. The European Central Bank, which has been propping them up for months, could restart money flows and help Greek banks reopen -- but only if it's convinced the reform process is progressing. The ECB said Monday that it was not ready to do so yet.
What's in the deal?
The bailout agreement also calls for tough austerity measures -- some tougher than Greece has previously been asked to endure.
For instance, the Greek government agreed to transfer up to 50 billion euros worth of Greek assets to an independent fund that will raise money from privatization.
According to the document, 25 billion euros from this fund will be poured into the banks, 12.5 billion will be used to pay off debt, and the remaining 12.5 billion to boost the economy through investment.
The fund will be based in Greece and run by the Greeks, but with supervision from European authorities.
Tsipras also agreed to push for broader economic reforms.
Greece's pensions system will be reformed in order to make it more sustainable. The country spends more on pensions as a proportion of its economy than any country in the European Union -- more than double that of some, such as Slovakia, Estonia and Ireland.
The new agreement asks for higher standard retirement age to 67. The current standard is 65 -- but the complex Greek pension gives a high proportion of workers the option to retire much earlier than that. That too has to change as part of the reform. Some benefits given to the poorest pensioners on top of their pensions will also be cut.
Greece will also have to reform its tax system to make it more efficient. The government had to give in on some of the key battlegrounds of the last few months, and agreed to raise the VAT on restaurants and other items to the top rate of 23%, and committed to abolishing the lower VAT rate on Greek islands popular with tourists. It is also going to raise corporation tax to 28%.
Under the new deal, Tsipras also signed up to new budget targets in line with those of other European countries, and to even more spending cuts.
The deal will be difficult to swallow for Greek voters, who were promised the exact opposite by their government.
"Tsipras will now have to implement the opposite of many things he had promised his voters in January and in June," Berenberg analyst Holger Schmieding said.
But then again, Greece needs a lot of money very fast if it wants to stay in the euro.