Brussels - Britain and the European Union reached a historic deal on Brexit divorce terms on Friday that allows them to open up talks on a future relationship after the split.
Prime Minister Theresa May rushed to Brussels for early morning talks with European Commission President Jean-Claude Juncker to reach the breakthrough.
The European Commission announced that it "recommends sufficient progress" had been made by Britain on separation issues including the Irish border, Britain's divorce bill, and citizens' rights.
But EU President Donald Tusk -- who will recommend to leaders at a summit next week to open trade and transition talks -- warned that the toughest task was to come.
- Northern Ireland 'alignment' -
"Let us remember that the most difficult challenge is still ahead. We all know that breaking up is hard but breaking up and building a new relation is much harder," Tusk said.
Negotiators worked through the night to seal an agreement after the EU set a deadline of Sunday.
May said the key part of the agreement was to ensure there would be no return of checkpoints on the frontier between British-ruled Northern Ireland and EU member Ireland after Britain leaves on March 29, 2019.
"In Northern Ireland we will guarantee there will be no hard border," she told a press conference with Juncker.
Northern Irish unionists who prop up May's minority Conservative government scuppered a possible deal on Monday with their fierce opposition to wording they felt would divide the North from the rest of the UK.
Arlene Foster, leader of the pro-British DUP party, told Sky News she was "pleased" to see changes to the deal following their demands.
The deal commits both sides to respect the 1998 Good Friday agreement, which ended decades of violence between nationalists who want a united Ireland and Northern Ireland unionists loyal to Britain.
Under the agreement, London will find a way to avoid a hard border on the island of Ireland "through the overall EU-UK relationship" but if this cannot be achieved, Britain will keep "full alignment" with the EU single market and customs union rules that are crucial to the Good Friday Agreement.
- Time warning -
Irish Prime Minister Leo Varadkar welcomed the deal as "the end of the beginning" but said Dublin would remain "vigilant" in upcoming negotiations.
On its divorce bill, previously the most contentious issue, Britain agreed to pay a settlement amounting to between 45 and 55 billion euros.
Concerning the welfare and social rights of some three million European citizens living in the UK after Brexit, as part of the deal Britain agreed to protect them with a mechanism to give EU citizens recourse to the EU's top court if they feel they are being treated unfairly.
Tusk however warned that there was "de facto less than a year" for trade talks as it has taken a year and a half since Britain's June 2016 Brexit referendum to settle divorce terms.
Former Polish premier Tusk, who deals with EU leaders, is expected to release draft guidelines on future relations on Saturday in time for member states to approve them for next week's summit.
He said he would propose the "immediate" opening of talks on a transition period, which Britain has estimated at around two years, but warned Britain would have to "respect the whole of EU law, including new law" during that period.
That is likely to be a red line for pro-Brexit members of May's Conservative party.
Tusk also called for more clarity from Britain on what kind of trade relationship it wants after leaving the EU's single market and customs union.
He said there would be a separate set of guidelines next year on EU-UK cooperation on security and terrorism.
The run-up to the deal had caused fevered speculation, with Juncker's chief of staff Martin Selmayr finally tweeting a picture of white smoke -- the sign used by the Vatican to signify the election of a new pope -- after May's arrival.
Juncker spoke first with Varadkar then with May on Thursday night in a bid to break a deadlock over the wording of a deal on future arrangements for the Irish border.
By Danny Kemp and Damon Wake