Ahead of a visit by Prime Minister Theresa May, the 27 leaders of the bloc met in Brussels to endorse the agreement, which sets the stage for Britain to exit the union on March 29.
"EU27 has endorsed the Withdrawal Agreement and Political Declaration on the future EU-UK relations," European Council President Donald Tusk tweeted, as the leaders waited for May to join them.
EU27 has endorsed the Withdrawal Agreement and Political Declaration on the future EU-UK relations.Donald Tusk (@eucopresident) November 25, 2018
Arriving for a special summit in Brussels, European Commission President Jean-Claude Juncker, head of the bloc's executive arm, said it was a "sad day".
"To see a country like Great Britain ... leave the EU is not a moment of joy nor of celebration, it's a sad moment and it's a tragedy," he said.
The deal took 18 months of tough negotiations before it was hammered out. It covers finance, citizens' rights, Northern Ireland, a transition phase, and reflects on future security- and trade ties.
The final draft was almost derailed by a last-minute row over the British territory of Gibraltar, which Spain claims as its own, which resolved on Saturday with the UK promising to bilateral talks would continue on the issue.
Theresa May says the Brexit deal will deliver her country a "brighter future".
But there is one last hurdle to overcome: the British House of Commons in London must still approve the deal before "Brexit day", designated by the European Union (Withdrawal) Act 2018 as 29 March, 2019 at 11:00 pm.
The Sunday Telegraph reported that members of May’s cabinet and EU diplomats are secretly working on "plan B" proposals, after 91 Conservative MPs indicated that they would oppose it in the Commons.
But in the letter, published in several newspapers, May insisted her agreement would "honour the result" of the 2016 referendum – when 52 percent backed Leave – and that it would be "a moment of renewal and reconciliation".
'No reason to be happy'
Until the agreement is approved, all sides are still bracing for the possibility that Britain ends its four-decade EU membership with no new arrangements in place – the so-called “hard Brexit.”
EU Council President Donald Tusk, who has always said he would prefer Britain not to leave, had said on the eve of the summit that "no-one will have reasons to be happy" when Brexit happens.
But he said terms had been agreed that would "reduce the risks and losses."