Theresa May has agreed an historic Brexit divorce deal with the European Union, paving the way for the negotiations to move onto future trade talks.
After a pre-dawn meeting in Brussels, the Prime Minister joined European Commission President Jean-Claude Juncker in announcing the breakthrough.
Juncker announced that "sufficient progress" had been made in the talks to allow both sides to move onto discussions of a future trade deal between the UK and EU after 2019.
May said the deal "had required give and take on both sides" and after "some tough negotiations" she had agreed the 'divorce bill', which is expected to total up to £50bn.
She also guaranteed rights for EU and UK citizens, including a continuing, time-limited role for the European Court of Justice, and new words on the crucial issue of Northern Ireland.
"I'm confident that we can ensure we both won't have a hard border in Northern Ireland but will retain the economic integrity of the United Kingdom," May said.
"In Northern Ireland we will guarantee there will be no hard border. We agreed...there should be no barriers north-south or east-west."
The deal came after a night of lengthy telephone diplomacy with the Democratic Unionist Party (DUP) over the fate of the Irish border in any future post-Brexit trade deal.
The DUP, which props up May's minority government in Westminster, gave the first confirmation of the breakthrough when its leader Arlene Foster announced the whole of the UK would quit the EU single market and customs union.
Foster insisted that "six substantive changes" had been made to an earlier draft agreement on how Northern Ireland would conduct its trade with the Republic of Ireland and the rest of the UK.
But she also made plain she was not entirely happy and that May had forced the issue in order to meet Brussels' deadline of sorting a deal by Sunday, ahead of next week's EU summit with all 28 national leaders.
"There are still matters there that we would have liked to clarify. We ran out of time essentially," Foster said. But she added "there's no red line down the Irish sea".
The breakthrough today means the UK can now begin talks on a post-Brexit free trade agreement with Brussels.
The EU had refused to progress negotiations to phase two until a deal was done on the Irish border, citizens' rights and how much money the UK will pay as it leaves the bloc.
Both sides met over croissants in Brussels but after just over 30 minutes both May and Juncker emerged to announce a deal had been done and the EU summit next week is now expected to approve it.
Juncker said that he was "sad" that the UK was leaving the union, but said the two sides would "take things one step at a time" to agree issues such as trade and security in the "second phase of these challenging negotiations".
The first sign of a deal came when Juncker's chief of staff Martin Selamyr tweeted a picture of white smoke emerging from the Vatican, a traditional symbol that an historic decision had been reached.
At their joint press conference, May explained that she wanted the future free trade deal with the EU to be all-encompassing for the whole of the UK, including Northern Ireland.
The PM said that "if that is not the case, we will look to" agreeing a cross-border solution that recognised the "specific circumstances of Northern Ireland" and its "unique" role as the only land border between the UK and the EU.