A Greek exit from the eurozone has been avoided after a weekend of tough talks, but the political cost of arriving at a deal is likely to be felt for years to come.

After 18 hours of negotiations, culimnating six months of wider talks, euro leaders emerged bleary-eyed on Monday morning (13 July) to announce a deal that will, eventually, see Greece get a new bailout if it takes painful reforms and if it agrees to intense scrutiny at every step of the way.

Student or retired? Then this plan is for you.

It is unclear if Tsipras will be able to get the terms of the agreement through the Greek parliament (Photo: The Council of the European Union)

The immediate result was summed up by European Commission president Jean-Claude Juncker.

"There will be no Grexit”, he said.

He noted that he’s happy with the "form and substance" of the deal, adding: "I don’t think the Greek people have been humiliated and I don't think the other European leaders lost face".

But despite his assessment, the deal represents capitulation on nearly all points for the left-wing Greek government, which was elected on a platform to stop austerity and which, just one week ago, held a referendum in which Greek people rejected creditors' demands.

With trust between Athens and creditors almost non-existent, Greece is being told it must take “prior actions” by Wednesday, including new laws on VAT hikes, pension cuts, and statistical office reforms, as well as ratification of the summit’s entire, seven-page austerity blueprint.

The creditors and the Eurogroup will formally scrutinise compliance before other eurozone parliaments vote on the summit terms.

Another proviso in the summit deal includes the return of the creditor institutions’ officials, the widely-hated, formerly called “troika”, to Athens.

Since February, at Athens' insistence, negotiations only took place in Brussels. In addition all "draft legislation in relevant areas" must first be shown to creditors before being put before Greek MPs.

Greek PM Alexis Tsipras also received next-to-no concessions on debt relief, which had - along with pensions and VAT - been one of his red lines.

"Nominal haircuts” were, once again, explicitly ruled out. Debt reprofiling will only be considered down the road "if necessary".

The deal saw Germany - Greece's biggest and most hardline eurozone creditor - receive flak on social media for pushing for such tough terms including a temporary eurozone exit, even after it was clear that Athens had backed down.

Berlin's hardline stance is popular at home, where public opinion has hardened against Greece. But it split the eurozone.

A rift emerged between those who supported a more conciliatory and political line towards Greece (including France and Italy), and those who sided with Germany (such as Finland and the Netherlands) for a more rules-based approach.

"There was in Germany rather strong pressure for a Grexit. I refused that solution," French president Hollande said after the meeting.

French experts had been instrumental in bringing a Greek deal back to the table ahead of the summit.

The entire weekend exposed the limits of the eurozone architecture, which is monetary union without a political union to back it up.

This meant the negotiations boiled down to whose democratic mandate counted for more: that of Tsipras, who pledged to end austerity, or that of Angela Merkel, the German chancellor?

It also meant talks had to take into account that the Finnish government might collapse if the Greek terms were too soft, or that other bailed-out states, such as Ireland or Portugal, did not want debt relief for Greece after having failed to get it for their own people.

Asked whether she felt the EU is now a “German Europe” in light of the summit deal, Merkel said: "I did not have that impression this morning".

Dutch PM Mark Rutte, for his part, noted that sending more money to Greece will mean that he’s breaking his electoral promise to the Dutch people.

Ireland's Enda Kenny said the summit was a "pretty bruising experience".

For his part, Juha Sipila, the Finnish PM, noted that Helsinki had been in favour of Berlin's proposal to eject Greece from the euro for five years.

He said he cannot guarantee that his parliament will accept to open negotiations on a third bailout.

It is also not sure whether Tsipras will be able to get the terms of the agreement through his parliament. Or that Merkel will get it through hers.

Tsipras, on his way out of the summit, said the deal "gives hope of recovery" but acknowledged it will be "difficult to implement".

Meanwhile, for ordinary Greeks, the austerity measures will continue and the answer to the question of when they can start withdrawing more than €60 a day from their bank accounts remains unclear.