It was a dramatic night of shuttle diplomacy that capped off an extraordinary political week – even by the standards of life at Westminster.
Theresa May had been warned by the EU that she effectively had until midnight on Sunday to salvage an agreement or face a long delay in starting Brexit trade talks.
So late on Thursday, the Prime Minister raced against the clock to get a last-minute deal on the table and agreed by all sides in time for a critical EU summit next week.
Incredibly, the No 10 staff Christmas party was ‘going on around’ her as she worked to secure the breakthrough.
Once the final details of the deal had been hammered out and the PM had grabbed only ‘a couple of hours’ of sleep, she caught a pre-dawn flight to Brussels.
Prime Minister Theresa May and Brexit Secretary David Davis smiled alongside EU officials after securing a last-minute Brexit deal
Here LARISA BROWN describes how a week of drama unfolded:
Sunday, December 3
Speculation that a deal is imminent mounts as Mrs May prepares to meet European Commission president Jean-Claude Juncker and EU Council president Donald Tusk for crunch talks in Brussels.
Monday
The PM travels to Brussels ahead of a lunch with Mr Juncker and chief EU Brexit negotiator Michel Barnier.
Government sources play down the prospect of a deal, describing the meeting as a ‘staging post’ ahead of a summit of EU leaders the following week.
The deal is necessary for talks to move to the next stage where both sides can begin negotiations on a trade deal.
A spokesman insists there are ‘plenty of discussions still to go’ before a deal is struck.
But EU officials brief that a deal is imminent, in what is seen as an attempt to ‘bounce’ Mrs May into a quick agreement.
Mr Juncker meets Ireland’s prime minister, Leo Varadkar, minutes before meeting Mrs May, amid reports of a major compromise to ensure there is no hard Irish border – a key demand by Dublin.
Mr Tusk then fuels hopes of a deal when he says the two sides are ‘getting closer’.
11am: However, things start to unravel when details of a draft deal are leaked to the Irish media. Philippe Lamberts, a Green MEP from Belgium, tells reporters that he’s seen a 15-page joint statement and Britain has accepted the ‘reality’ of their situation.
He says it states that the UK will commit to ‘regulatory alignment’ between the Irish Republic and Northern Ireland, regardless of the outcome of negotiations.
That would mean Northern Ireland remaining in the single market and customs union, avoiding the need for a hard border.
Mrs May was pictured greeting EU President Jean-Claude Juncker after she arrived in Brussels just before 6am. Talks started almost immediately after
This is quickly seized upon by SNP leader Nicola Sturgeon and London mayor Sadiq Khan, who demanded separate deals for Scotland and the capital.
12.20pm: A lunch starts with Mrs May, Brexit Secretary David Davis, Mr Juncker and Mr Barnier. EU diplomats and journalists had been told to expect a 15-page document outlining details of a deal that would clear the way for trade talks to begin.
But the PM is forced to break away to field an angry call from Democratic Unionist Party leader Arlene Foster, who has gone public with her concerns about the leaked draft.
She immediately vetoes plans for a compromise on the status of the Irish border and the agreement is dramatically put on hold.
2.30pm: Surprise as the planned statement does not go ahead.
4pm: Late in the afternoon, Mrs May and Mr Juncker face the Press in Brussels to announce that discussions on a divorce deal have been abandoned for the day. Mr Varadkar says he is ‘surprised and disappointed’ no deal has been secured yet. Mrs May is forced to return to London.
Tuesday
Mrs Foster says she will not accept plans to retain ‘regulatory alignment’ between Northern Ireland and the Republic after Brexit. The Prime Minister cancels plans to return to Brussels on Wednesday as talks continue, with no sign of a breakthrough.
Wednesday
Mrs May speaks to both Mr Varadkar and Mrs Foster, but government sources say there is ‘clearly still work to do’ on the central issues.
Later that afternoon, the Prime Minister decides to pull out of a trip to see the commissioning of Britain’s new aircraft carrier – the HMS Queen Elizabeth – the next day in Portsmouth.
Brexit Secretary David Davis embraced EU President Juncker early on Friday just hours before the deal was struck
Thursday
11am: Mrs May has her staff photo, usually taken at the evening Christmas party, taken hours ahead of schedule at No 10.
4.30pm: After delivering a warning shot to the Prime Minister over compromises, Foreign Secretary Boris Johnson goes to No 10 to see how the talks are getting on. Chancellor Philip Hammond hosts a children’s charity Christmas party at No 11 with festive elves.
5pm: The first indications of a breakthrough emerge as Mr Tusk says he will make a statement early on Friday.
Government sources play down expectations, declaring: ‘We’re not there yet.’
Nigel Dodds, the leader of the DUP at Westminster, leaves talks after agreeing in principle to new wording for a deal.
7.30pm: Mrs May speaks to Jean-Claude Juncker and Mr Varadkar in separate phone calls.
The chief spokesman for the commission, Margaritis Schinas, tweets: ‘We are making progress but not yet fully there. Talks are continuing throughout the night.’
9pm: As Downing Street staff sing karaoke at their Christmas party in No 10, Mrs May speaks to DUP leader Mrs Foster, who demands more changes.
Mrs May doesn’t drink any alcohol because she has to keep working, but her staff upstairs enjoy wine, beer, flavoured crisps and sour cream pretzels.
Mrs May shook hands with the president of the European Council Donald Tusk before the meeting in Brussels
11pm: Second phone call to Mrs Foster, and DUP’s objections are resolved. The Prime Minister makes it clear she is going ahead with the deal.
11.30pm: No 10 Christmas party ends and the staff go home. The PM decides she is ready to go to Brussels with an agreement. Government chief whip Julian Smith signals that No 10 has put the final touches to a deal which all sides can agree.
He tweets: ‘Theresa has worked tirelessly this week to try to move EU negotiations onto the next stage in the National Interest.’
As the PM leaves her office in Downing St she is wished ‘good luck’ by her chief whip, the Northern Ireland secretary, her chief of staff and others who were in the room with her for the talks.
She heads to her home in her Maidenhead constituency, west of London, to snatch a ‘couple of hours’ sleep.
YESTERDAY
3.45am: After her nap, Mrs May is driven to RAF Northolt in west London. Brexit Secretary David Davis and No 10 chief Brexit adviser Olly Robbins join her. Minutes later, the European Commission announces that Mrs May and Mr Juncker are ‘likely to meet’ in the morning.
4.30am: The RAF BAe146 jet takes off for Brussels and the Cabinet Office confirms Mrs May is heading ‘for further meetings on the Brexit negotiations’.
5.55am: Mrs May arrives to a hug from Mr Juncker while she still has her coat on. Mrs Foster says six ‘substantive changes’ have been made to the text she blocked on Monday, ensuring ‘no red line down the Irish Sea’.
Talks start immediately.
6.06am: Mr Juncker’s chief of staff, Martin Selmayr, tweets a photo of white smoke billowing from the chimney of the Sistine Chapel – the traditional means of announcing that a new pope has been chosen. It is the first inkling a deal has finally been done.
British sources have confirmed that the UK’s financial settlement will be an estimated £35-£39billion
A photo is also tweeted of Mr Juncker, the Prime Minister and other key figures enjoying orange juice, Actimel yoghurt, croissants and crusty bread, saying: ‘Working breakfast under way’.
Later, No 10 refused to be drawn on claims that Mr Juncker served champagne at the breakfast.
6.40am: Mrs May and Mr Juncker hold a Press conference, to herald the deal, with the Prime Minister declaring it ‘a hard-won agreement in all our interests’.
7.33am: At the European Council, Mr Tusk confirms he has sent proposals to the other 27 EU leaders for a new negotiating mandate, covering trade and the transition to a post-Brexit relationship.
8.18am: Ireland’s prime minister, Mr Varadkar, says the Brexit deal has ‘achieved all we set out to achieve’, but adds: ‘This is not the end, it is the end of the beginning.’
8.47am: The EU’s chief Brexit negotiator, Mr Barnier, sets out full details of the agreement in a Press conference.
9.30am: Mrs May arrives back in her constituency. She goes on to attend a dementia charity event and holds other meetings.
10.21am: British sources confirm that the UK’s financial settlement will be an estimated £35-£39billion.