The crunch point was a long time coming.
After a dinner of soup, cod and chocolate cake and ice cream, the 27 European Union leaders spent more than six hours discussing the technical details of the plan to create fiscal union in the 17-member eurozone.
It was not until 2.30am that David Cameron got to the heart of the matter, whether the deal would be signed by all 27 EU members, as most of those round the table in the Justus Lipsius building wanted. But several other leaders were genuinely shocked by the Prime Minister's demands for legally binding measures to prevent the City of London being disadvantaged by the "fiscal compact".
Mr Cameron argued that any transfer of power from a national regulator to an EU regulator on financial services should be subject to a veto; that banks should face higher capital requirements; and that the European Banking Authority should remain in London rather than switch to Paris. He also opposed the European Central Bank's plan for euro-denominated transactions within the eurozone.
For other leaders, the point of the meeting was to end the turmoil threatening the euro's very survival as it approaches its 10th birthday on 1 January. Mr Cameron, they thought, had badly misread the mood: they had not come to Brussels to demand Christmas presents at a traditional summit. And several leaders regarded the City of London as one of the root causes of Europe's economic problems. They saw the Prime Minister as offering nothing in return, which is why one French official likened him to "a man attending a wife-swapping party without his wife".
An animated Mr Cameron, sustained by black coffee, insisted his demands were "perfectly reasonable". But there were no takers. Jose Manuel Barroso, the European Commission President, anxious to prevent a schism, proposed a form of words to allay Mr Cameron's fears, that the eurozone deal would "not distort competition, trade or financial services". But it didn't specifically mention London and so was unlikely to placate the Conservative Eurosceptics who had put the Prime Minister under enormous pressure before the summit.
A five-minute pause for breath at 3.30am made no difference to the situation. Mr Cameron had made two fatal miscalculations, say EU sources. First, Germany's Angela Merkel failed to throw her weight behind him. Her focus was on the euro, and the British demands had nothing to do with that. Second, none of the other nine "outs" backed him, even though they wanted a 27-strong deal.
One by one, they made clear they were ready to agree "a treaty outside the EU treaty" by turning the eurozone into a "euro-plus" group. Only Hungary, Sweden and the Czech Republic reserved their positions, but last night they looked increasingly likely to join the ever-expanding "euro-plus" group, which would leave the UK in a minority of one. Nicolas Sarkozy, the French President, was certainly not going to ride to Mr Cameron's rescue. All along, he had favoured a treaty based on the 17. Now he was getting his way and could barely disguise his glee.
When the summit's nine-hour session broke up at 5am, the hyperactive Mr Sarkozy was fast out of the traps, announcing the dramatic news at a hastily convened press conference. Some journalists and diplomats doubted his version of events; surely Britain alone had not vetoed a treaty to save the euro? But 15 minutes later Mr Cameron confirmed at his own press conference that he had done just that.
He said: "I had to pursue very doggedly what was in British national interest. It is not easy when you are in a room where people are pressing you to sign up to things because they say it is in all our interests." He added: "It is sometimes the right thing to say, 'I cannot do that, it is not in our national interest, I don't want to put that in front of my Parliament because I don't think I can recommend it with a clear conscience, so I am going to say no and exercise my veto'."
Mr Cameron grabbed two hours' precious sleep at the British ambassador's residence before being woken at 8.15am yesterday. After breakfast – full English, of course – he returned to the European Council building for the remaining, relatively mundane business on the summit agenda, including the signing of an accession treaty allowing Croatia to join the EU. "I stopped a treaty and signed a treaty," Mr Cameron quipped.
But his EU partners were in no mood for laughs when he entered the meeting room at 9.15am. Insiders said he was greeted by a stony silence. The shockwaves of the long night before were still reverberating. There was bemusement, as well as anger, at Britain's tactics. "Cameron lost a lot of friends," said one EU source. Another added: "Cameron completely blew it. He kept pushing for more and things tipped over the edge."
A Dutch diplomat said: "This was a very calculated trap by the French and Cameron fell right into it. The French were very astute, they are extremely good. They knew how difficult this would be for Cameron and they played their cards right." Another Brussels insider said: "It is an own goal. Cameron has left with nothing. All he got is a day's headlines to please his Eurosceptics. The long-term damage to Britain's influence will be immense."
An unrepentant Mr Cameron flew back to Britain last night, assured of a more friendly reception than he received in Brussels. He headed for his Chequers country residence, and a reception for several Tory MPs. Fittingly, they included Andrew Rosindell, the right-winger who has a bulldog and urged Mr Cameron to show the "bulldog spirit" in Brussels at Prime Minister's Questions on Wednesday.