The agreement paves the way for EU leaders at a summit on December 14-15 to open the second phase of Brexit negotiations, covering trade talks and a transition period.
Britain voted in June 2016 to become the first state to leave the EU, after more than four decades of membership, but the talks have been slow moving and often acrimonious so far.
"The Commission is satisfied that sufficient progress has been achieved in each of the three priority areas," the European Commission said in a statement.
Negotiators worked through the night to seal an agreement on the terms of Britain's departure from the bloc.
The EU had set a deadline of Sunday after the last talks on Monday broke down when May's Northern Irish allies objected to terms for future arrangements for the Irish border.
European Commission chief Jean-Claude Juncker's chief of staff Martin Selmayr tweeted a picture of white smoke -- the sign used by the Vatican to signify the election of a new pope -- shortly after May's arrival.
Juncker spoke first with Irish Prime Minister Leo 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.
Britain agreed to pay a divorce settlement amounting to between 45 and 55 billion euros and to protect the rights of some three million European citizens living there after Brexit as part of the deal.
But Ireland's demands that Brexit should not lead to the return of checkpoints on the border with Northern Ireland, which it said could jeopardise the peace process in the north, proved the biggest stumbling block at the end.
"In Northern Ireland we guarantee there will be no hard border," May told a press conference with Juncker.
The pro-British DUP party which props up May's government refused Monday's draft deal over a phrase suggesting there would be "regulatory alignment" with the EU after Brexit -- effectively putting Northern Ireland under EU law.
DUP leader Arlene Foster told Sky News there had now been changes following talks with May.
"We're pleased to see those changes because for me it means there's no red line down the Irish Sea and we have the very clear confirmation that the entirety of the United Kingdom is leaving the European union, leaving the single market, leaving the customs union," she said.
'Totally and utterly incompetent'
On Thursday, EU Commission spokesman Margaritis Schinas had dismissed British newspaper reports that the Sunday deadline could be extended into next week as "not correct".
Scotland's nationalist leader showed little patience, accusing the British government of being "totally and utterly incompetent" on Brexit.
First Minister Nicola Sturgeon said "the real lesson" of the past week was that Scotland "will always be at the mercy of reckless decisions taken by Tory governments at Westminster" unless it becomes independent.
"The sooner we are in control over our own future here in Scotland the better, and this week has proved it," she added.
Eurogroup chief Jeroen Dijsselbloem offered some calming words, saying Britain's City of London financial hub "will not fall apart" after Brexit even if it loses the right to allow banks to trade freely across the bloc.
Dijsselbloem, the Netherlands finance minister who chairs meetings of his counterparts in the 19-country eurozone, said that some businesses would nevertheless have to relocate.
"I don't believe that the City will fall apart and that everyone will flee. I don't think that's how it's going to work," he told a European Parliament committee.
His reassurances come at a time when Britain's finance sector is anxious about losing the "passporting" rights which allow large international banks to trade throughout the EU while being based in Britain.
- with AFP