Brussels, Belgium (CNN) All 27 remaining European Union leaders signed off Britain's Brexit agreement with mixed emotions at a special summit on Sunday -- but the deal's real test is yet to come.

While EU leaders mourned a "sad day" in the bloc's decades-long history, UK Prime Minister Theresa May disagreed, saying "I am full of optimism."

Less than an hour after members gathered in Brussels, European Council President Donald Tusk tweeted that they had endorsed the "Withdrawal Agreement and Political Declaration on the future EU-UK relations."

The agreement is a small victory for May, who must now persuade lawmakers in the UK Parliament to vote for her deal.

German Chancellor Angela Merkel and European Commission President Jean-Claude Juncker greet each other in Brussels on Sunday.

Given that opposition parties -- not to mention many lawmakers within May's Conservative party and the Northern Irish DUP, which supports her minority government -- have indicated they'll vote against it, the deal is far from sealed.

Read More