The closest Greece has come to leaving the eurozone was at around 6am on Monday morning, just as dawn was breaking over Brussels.

Alexis Tsipras of Greece and Angela Merkel, the German chancellor, decided after 14 hours of anguished talks that they had reached a dead end. With no room for compromise, neither saw any reason to carry on. Grexit was the only realistic option.

As the two leaders made for the door it was Donald Tusk, the president of the European Council, who moved to prevent the fatigue and frustration from triggering a historic rupture for the eurozone.

“Sorry, but there is no way you are leaving this room,” the former Polish prime minister said.

The sticking point was the size and purpose of a privatisation fund to be backed by sequestered Greek assets. Ms Merkel wanted the €50bn of sales to be devoted to debt repayments; Mr Tsipras saw that as a national humiliation that would cede control of assets worth almost a third of Greek national income. His alternative was a smaller fund, whose proceeds would be reinvested in Greece.

A compromise was ultimately found after more than an hour discussing nearly a dozen different structures. It was to be the coda to a weekend that featured one of the most exhausting and fraught negotiations in a seemingly interminable crisis that has provided the EU’s sternest test.

After almost nine hours of fruitless discussions on Saturday, a majority of eurozone finance ministers had reached a stark conclusion: Grexit — the exit of Greece from the eurozone — may be the least worst option left.

Michel Sapin, the French finance minister, suggested they just “get it all out and tell one another the truth” to blow off steam. Many in the room seized the opportunity with relish.

Alexander Stubb, the Finnish finance minister, lashed out at the Greeks for being unable to reform for half a century, according to two participants. As recriminations flew, Euclid Tsakalotos, the Greek finance minister, was oddly subdued.

The wrangling culminated when Wolfgang Schäuble, the German finance minister who has advocated a temporary Grexit, told off Mario Draghi, European Central Bank chairman. At one point, Mr Schäuble, feeling he was being patronised, fumed at the ECB head that he was “not an idiot”. The comment was one too many for eurogroup chairman Jeroen Dijsselbloem, who adjourned the meeting until the following morning.

“It was extremely hard, violent even,” said one participant.

In depth Greece debt crisis The anti-austerity government in Athens scored a decisive victory as voters backed its call to reject a compromise with international creditors, raising serious doubts about the country’s ability to remain inside the eurozone Further reading

Failing to reach a full accord on Saturday, the eurogroup handed the baton on Sunday to the bloc’s heads of state to begin their own an all-night session.

As the hours passed and Sunday turned to Monday, the prospect of a Grexit seemed to grow more probable, participants said, heightening divisions between sleep-deprived politicians and diplomats that have developed over six months of mostly frustrating negotiations.

A senior official in the room believed that Germany was now the country that appeared to be acting in bad faith — no longer the Greek prime minister Alexis Tsipras. At one point, Mr Tsipras had to endure a lecture from Miro Cerar, the Slovenian prime minister, to which Italian prime minister Matteo Renzi objected.

Eventually, François Hollande, the French president who has battled to keep Greece in the fold, ushered Ms Merkel and Mr Tsipras into Mr Tusk’s office to finalise a compromise on the privatisation fund. Although they were ultimately successful, the negotiations appeared to strain the Franco-German relationship long at the heart of the European project.

“There was in Germany a rather strong pressure for a Grexit. I refused that solution,” Mr Hollande told reporters after a deal was reached.

Podcast Who loses most from the Greek rescue deal? http://podcast.ft.com/p/2987 On Monday Athens was given a long list of economic reforms it needed to implement in return for another EU bailout. Was it a humiliation for the Greeks or a capitulation by the Germans? Gideon Rachman and Wolfgang Munchau discuss who was the biggest loser.

On the privatisation fund, in particular, Mr Hollande gave backing to Mr Tsipras. It was a question of “sovereignty,” the French leader said. “Nothing would have been worse than humiliating Greece, Greece didn't seek charity, but solidarity from the eurozone.”

Mr Hollande also insisted that the possibility of a temporary Greek exit from the eurozone — a controversial initiative Mr Schäuble had managed to insert into the eurogroup proposals — be removed from the final document.

In the end, some bleary-eyed diplomats emerged unsure who had prevailed in the marathon session. But they seemed agreed as to who had suffered most.

“They crucified Tsipras in there,” a senior eurozone official who had attended the summit remarked. “Crucified.”

Additional reporting by Stefan Wagstyl