Brexit: Watching the deal unfold in Brussels - BBC News
The BBC's Adam Fleming shares how he watched the last-minute Brexit deal unfold from Brussels.
This video can not be played To play this video you need to enable JavaScript in your browser. The prime minister said the deal will allow more to be invested in "priorities at home"

I had been warned to keep my phone by the bed. It rang at 05:09 here in Brussels (04:09 GMT). "The prime minister is in the air," said my government source.

Theresa May's motorcade arrived at the HQ of the European Commission less than two hours later.

There were hugs for all as she, her chief civil servant negotiator Olly Robbins and Brexit Secretary David Davis were met by European Commission President Jean-Claude Juncker and Michel Barnier, the EU's Mr Brexit.

Pictures were released showing the two sides enjoying fruit juice and pastries.

It was obvious a deal was being done. Why put everyone through this otherwise?

Aides filed into the briefing room ahead of the big news conference. They wore the opposite expressions they had had on Monday when hopes of a deal evaporated under pressure from Northern Ireland's Democratic Unionist Party.

The two sides of Brexit shared juice and pastries in Brussels on Friday morning

Mr Juncker sketched out the agreement that had been reached: financial obligations had been clarified, the European Court of Justice would remain "competent" to guarantee the rights of EU nationals in the UK, and a hard border would be avoided on the island of Ireland.

It was a personal triumph for the prime minister, he said.

I asked the prime minister what compromises had been made to get here. She said it had been about both sides working together.

Diplomats said the display of mutual respect demonstrated that the next phase of talks will be less bad-tempered, less fraught and more collegiate now that divorce-related issues have been broadly settled.

Deal: Mrs May is welcomed by Mr Juncker in Brussels

Later we heard from Michel Barnier. At length.

His pride in the deal he had negotiated was evident as he explained it in painstaking detail. He gently chided journalists who had failed to grasp the complexities of the compromise on Ireland.

He reminded everyone that he had never speculated about the size of the UK's financial obligations (£35bn-£39bn, according to British estimates).

Mr Barnier complained that I always posed the same question about whether he was prepared to make any concessions.

Afterwards I asked if he would be cracking open a bottle of champagne. "No," he replied. "You have to drink water when you are negotiating and there's still a lot of work to do."

This video can not be played To play this video you need to enable JavaScript in your browser. "No champagne" for the Brexit negotiators, who "have to drink water"

The scale of that work became clear as the action switched to the European Council, where the member states are represented.

Donald Tusk, who will chair next week's summit of EU leaders, said this had been the easy part. Negotiating a transition deal and the outlines of a future partnership on trade, security and defence will be more difficult and had to be done within a year, he said.

The EU desperately wants the UK to clarify what kind of post-Brexit relationship it wants.

Some European officials fear the debate triggered at Westminster this week by the impasse over Northern Ireland is a harbinger of the row to come as Britain tries to define its future.

This video can not be played To play this video you need to enable JavaScript in your browser. Tusk: 'Breaking up is hard, building a new relationship is harder'

For me, the series of mini dramas I have covered for the last six months have been consolidated into 15 pages of pledges and commitments.

The draft guidelines for the second phase of the talks hint at some of the plot twists to come.

Briefly it felt like Brexit was sorted. It is just starting.