The frantic 24 hours that shaped future of Europe
This is how the night and morning played out as a Brexit deal was finally hammered out (all times UK).
THURSDAY, DECEMBER 7
7.30pm: Mrs May speaks with European Commission president Jean-Claude Juncker and Irish Taoiseach Leo Varadkar in separate phone calls.
9pm: PM phone call with DUP leader Arlene Foster.
11pm: Second phone call with Mrs Foster, during which it was agreed that the Northern Irish party's objections had been resolved.
11.53pm: Government chief whip Julian Smith tweets: "Theresa has worked tirelessly this week to try to move EU negotiations onto the next stage in the National Interest", apparently signalling the moment when Number 10 put the final touches to a deal which all sides could agree.
FRIDAY, DECEMBER 8
3.45am: After a couple of hours' sleep, Mrs May leaves Number 10 to be driven by official car to RAF Northolt in west London.
4.30am: An RAF BAe146 jet of the Royal Flight takes off for Brussels with Mrs May and Mr Davis on board.
5.54am: Mrs May and Mr Davis arrive at the European Commission's Berlaymont HQ, to be greeted by Mr Juncker.
5.55am: Mrs Foster says "substantive changes" have been made to the text which she blocked on Monday, ensuring "no red line down the Irish Sea".
6.06am: Mr Juncker's chief of staff Martin Selmayr signals that a deal has been concluded.
6.40am: After finalising their agreement over breakfast, Mrs May and Mr Juncker hold a press conference, in which the Commission president says that "sufficient progress" has been made to move on to trade talks.
7.06am: Mrs May arrives at the European Council and is greeted by president Donald Tusk.
7.33am: Mr Tusk confirms he has sent proposals to the EU27 leaders for a new negotiating mandate, covering transition and trade.
8.18am: Ireland's Taoiseach Leo Varadkar says the Brexit deal had "achieved all we set out to achieve", adding: "This is not the end, it is the end of the beginning."
8.47am: The EU's chief Brexit negotiator Michel Barnier sets out full details of the agreement in a press conference.
10.21am: British sources confirm the UK's financial settlement will be an estimated £35-£39bn.