British and EU negotiators agree on first phase of Brexit talks after all-night talks between Theresa May, Jean-Claude Juncker, the DUP, and the Irish government.

May makes key concessions in order to push through a deal in time for the EU summit.

Britain will pay divorce bill worth up to £39 billion.

ECJ judges will have sway over UK courts until 2027.

Britain will comply fully with single market and customs union rules if Irish border isn't resolved.

LONDON — Prime Minister Theresa May has agreed the text of a Brexit divorce deal after holding all-night talks with European Commission President Jean-Claude Juncker, the DUP, and the Irish government.

May travelled to Brussels on Friday morning with Brexit secretary David Davis to Brussels for talks with the European Commission, before the deal was finalised and published by the EU.

"Getting to this point has required give and take on both sides," May told the world media this morning.

"I very much welcome the prospect of moving ahead to the next phase to talk about trade and security and to discuss the positive and ambitious future relationship that is in all of our interests."

The wording of the deal shows that the British side had to make concessions on a number of key issues in order to achieve "sufficient progress" and move talks onto trade and transition.

Here are the biggest areas of negotiations in which the British side was forced to climb down.

The Brexit bill: £39 billion

The text does not mention a specific figure in regards to the financial settlement Britain must pay.

However, it does say that Britain will pay its share of EU budget commitments "outstanding at 31 December 2020." This means Britain will make payments to the EU until the end of 2020, nearly two years after exit day in March 2019.

The UK government today confirmed that it will pay a Brexit bill of up to £39 billion.

This is a significantly larger sum than government ministers have previously said Britain should be willing to pay.

Earlier this year, Foreign Secretary Boris Johnson described reports of a £40 billion exit payment as "extortionate" and said the EU should "go whistle."

And in September Brexit Secretary David Davis sought to calm Brexiteers in his party by describing reports of a Brexit bill being as large as £40 billion as "made up."

He then hinted that the actual figure would be much smaller. "I'm not going to do an actual number on air, it would be ridiculous to do that, but we have a fairly clear idea where we're going on this," Davis said.

Single market and customs union: could be the default position

Boris Johnson and David Davis. REUTERS/Hannah McKay

Theresa May has repeatedly insisted that Britain will definitely stop participating in the single market and customs union in March 2019.

However, the text of the Brexit deal struck in the last 24 hours suggests it might not be that simple.

Point 49 of the text, pictured below, says that if British negotiators fail to come up with a means of avoiding a hard border between Northern Ireland and the Republic, then the UK "will maintain full alignment with those rules of the Internal Market and the Customs Union."

In other words, if the Irish dilemma is still without a solution by the end of negotiations, then remaining fully aligned with the single market and customs union is the default position.

This would seriously hamper the ability of the UK to make international trade deals and would prove hugely controversial with many Brexit-supporters.

European Courts: 8 more years of influence

May repeatedly promised to use Brexit as a means of cutting Britain off from the influence of European judges — primarily those in the ECJ.

"We will not have truly left the European Union if we are not in control of our own laws," she declared in her Lancaster House speech in January, putting total judicial independence at the very heart of her Brexit vision.

However, today's text agrees to allow the European Court Of Justice to have influence decisions made in UK courts on citizenship cases for 8 years after Brexit, stating that UK courts must have "due regard" to the ECJ in relation to the rights of EU citizens.

The prime minister plus a host of Cabinet ministers have claimed that the ECJ will no longer have sway over the UK after exit day in March 2019.

For example, in September Brexit Secretary Davis told Andrew Marr: "In 2019 we will leave, we’ll come out from under the jurisdiction and the lawmaking of the European Union."