The UK and the European Union reached a significant milestone in their pursuit of a Brexit deal on Friday, breaking a deadlock that allows talks to move on to a crucial second phase.
After a dramatic night of shuttle diplomacy that capped months of tortuous negotiations, European Commission President Jean-Claude Juncker and British Prime Minister Theresa May announced the breakthrough at an early morning press conference in Brussels.
Crucially, the two sides reached a deal on the historically sensitive issue of the Irish border, which had threatened to derail the talks as they reached a critical moment earlier this week. Discussions can now move on to the potentially tougher issue of a future trading relationship between the UK and the EU.
The breakthrough represents a significant coup for May, whose beleaguered premiership had appeared under threat as talks faltered. It was also a relief for EU negotiators, who feared a complete breakdown in talks if a deal was not done.
"Getting to this point required give and take on both sides," May said. "And I believe the joint report that is being published is in the best interest of the whole of the UK."
What has been agreed?
Agreement has now been reached on three key issues: Britain's Brexit "divorce" bill, the rights of EU citizens in the UK after Brexit, and the Irish border. When Brexit negotiations began just under six months ago, the EU was clear on its position: It would not countenance any discussion about a future trading relationship with Britain until "sufficient progress" had been made on those three issues.
The Irish question proved the toughest to resolve. The demilitarization of the border between Northern Ireland and the Republic of Ireland was a key element of the Good Friday Agreement, the 1998 deal that ended years of sectarian conflict in Northern Ireland. Now, the border posts are gone and people can move freely around the island of Ireland.
But Brexit raised the prospect of a return to a "hard" border, as Northern Ireland would leave the EU while the Republic of Ireland remained in the bloc.
Complicating the issue, May's minority government depends on the support of on a small group of 10 MPs from Northern Ireland, members of the hardline Democratic Unionist Party (DUP). They were adamantly opposed to any suggestion that, to avoid a hard border, Northern Ireland could retain laws and regulations that were more aligned to the EU than the rest of the UK.
The DUP vetoed the text of an earlier deal on Monday, just as May was having lunch with Juncker in Brussels to finalize it. She was forced to return to London as negotiators spent the rest of the week hammering out a solution acceptable to the DUP, the Irish government and the EU.
The language of the deal announced on Friday remains ambiguous. It says: "In the absence of agreed solutions, the UK will maintain full alignment with those rules of the internal market and the customs union which, now or in the future, support North-South cooperation, the all-island economy and the protection of the 1998 agreement."
That's a backstop. It means that, in the next stage of talks, the UK must come up with solutions that avoid a hard border, otherwise the UK will have to remain tied to EU rules even after Brexit. That scenario would enrage the ardent Brexiteers in May's Conservative Party.
The leader of the DUP, Arlene Foster, claimed she had secured "substantial changes" to the text she rejected on Monday, adding she was "pleased" to see changes which mean there is "no red line down the Irish Sea".
In a statement, the DUP said it had won clear that commitments from the Conservatives that "Northern Ireland will leave the single market and the customs union along with the rest of the United Kingdom."
Ireland's Prime Minister Leo Varadkar said that the UK had guaranteed there would be no hard border on the island of Ireland and that the 1998 Good Friday Agreement had been fully protected.
He added that the common travel area, the arrangement that allows citizens to travel freely between Britain and Ireland, would remain in place and that Irish and British citizens would continue to enjoy the same rights after Brexit as they do now.
On the divorce bill, the agreement says the UK would be required to continue contributions to the EU budget up to the end of 2020 "as if it had remained in the union".
The report adds that the UK will remain liable for its outstanding financial commitments and liabilities up to December 3, 2020.
There was also agreement on the rights of EU citizens after Brexit with the report stating that EU citizens living in the UK and vice versa will have their rights to live, work and study protected.
Discussions stretched into the early hours of Monday morning. When it was clear that a deal was done, and in the absence of any other way of getting to Brussels by a 6 a.m. deadline, May dashed to a Royal Air Force base in north London to board a private jet.
Speaking alongside May in the Belgian capital, Juncker said: "We had to make the deal today,| as a December 14 deadline approached.
"Sufficient progress has now been made on the three terms of the divorce," Juncker said. Negotiations for the UK to leave the EU can now proceed to the next stage.
May said the agreement was "fair to the British taxpayer" and resolved the outstanding issues of the Irish border. In Northern Ireland we will guarantee there will be no hard border, and we will uphold the (Good Friday Agreement)."
"No barrier north-south or east-west," she said.
In London, the reaction from May's colleagues was positive. UK environment minister Michael Gove, one of the leading figures in the Leave camp during the Brexit referendum, said: "I think it's important to recognise this is a significant personal political achievement for the Prime Minister."
"She got a deal in the interests of the whole of the UK, so the integrity of the UK is absolute and paramount," he told BBC Radio 4's Today programme.
But former UKIP leader Nigel Farage, who has long championed Brexit, criticized May over the deal, claiming the country could now "move on to the next stage of humiliation."
The Republic of Ireland's Deputy Prime Minister Simon Coveney said on Twitter Dublin "supports Brexit negotiations moving to Phase 2 now that we have secured assurances for all on the island of Ireland -- fully protecting (the Good Friday agreement), peace process, all-island economy and ensuring there can be NO HARD BORDER."