European Union leaders formally agreed a Brexit deal at a Brussels summit on Sunday, urging Britons to back Prime Minister Theresa May's package, which faces furious opposition in the British parliament.

The 27 leaders took barely half an hour to rubber-stamp a 600-page treaty setting terms for Britain's withdrawal from the European Union on March 29 and a 26-page declaration outlining a future free trading relationship.

"This is the deal," European Union chief executive Jean-Claude Juncker told reporters on his way into the meeting, saying he believed May would get it through parliament and ruling out big new concessions.

"Now it is time for everybody to take responsibility -- everybody," said Michel Barnier, the Frenchman who has negotiated on behalf of the EU.

Juncker called it "a sad day", saying Brexit was a "tragedy" and tough on both sides.

"I believe that the British government will succeed in securing the backing of the British parliament," Juncker said, declining to comment on what might happen if May fails.

"I would vote in favour of this deal because this is the best deal possible for Britain," he added.

In a sign of worries ahead, Lithuanian President Dalia Grybauskaite tweeted after the deal was endorsed in the summit chamber that the exit process was "far from over".

Barnier called the package a basis for close future ties, insisting: "We will remain allies, partners and friends." The President of the European Council Donald Tusk announced the agreement on Twitter.