The European Union removed the last major obstacle to sealing an agreement on Brexit after Spain said it had reached a deal Saturday with Britain over Gibraltar on the eve of an EU summit.
British Prime Minister Theresa May will then have the momentous task to sell the deal to her recalcitrant Parliament and a nation still fundamentally split whether the U.K. should leave the EU on March 29 and under what conditions.
Spanish Prime Minister Pedro Sanchez announced Saturday that Madrid would support the Brexit divorce deal after the U.K. and the EU agreed to give Spain a say in the future of the disputed British territory of Gibraltar, which lies at the southern tip of the Mediterranean nation.
"Europe and the United Kingdom have accepted the conditions imposed by Spain. Therefore, as a consequence of this, Spain will lift its veto and tomorrow will vote in favor of Brexit," Sanchez said.
Sanchez said that the deal is "is going to allow us to have direct negotiations with the U.K. regarding Gibraltar."
British Prime Minister Theresa May said later on Saturday the United Kingdom would "always stand by Gibraltar" after Spain got enough assurances over the peninsula to unblock the European Union's Brexit deal with London.
"We will always negotiate on behalf of the whole U.K. family, including Gibraltar," May said on arriving for talks in Brussels with Donald Tusk, the chairman of EU leaders' summit that is due to approve the Brexit deal on Sunday.
"We have worked through the withdrawal issues for Gibraltar in a constructive and sensible way," she said.
"We have ensured that Gibraltar is covered by the whole agreement and by the implementation period."
The move should allow EU leaders to sign off on the Brexit agreement between Britain and the EU at Sunday morning's summit.
The tiny territory of Gibraltar — ceded to Britain in 1713 but still claimed by Spain — was the only dispute left hanging before the summit and had turned into an obstinate stumbling block.
On Friday, Spain said it wouldn't back the Brexit deal unless it gets a cast-iron guarantee of its say over Gibraltar's future.
Sanchez said the agreement reached would give Spain "absolute guarantees to resolve the conflict that has lasted for more than 300 years before Spain and the U.K."
May was on her way to Brussels when the deal came through and hopes to leave EU headquarters on Sunday with a firm agreement on the withdrawal terms for Britain's departure from the EU on March 29, as well as a comprehensive negotiating text on how future relations should look like once both sides agree on a trade agreement.
May was to meet with European Commission President Jean-Claude Juncker and Council President Donald Tusk on Saturday evening.
Winning warm greetings from her 27 fellow leaders on Sunday might be much easier for May these days than getting such treatment from her Conservative party colleagues once she returns.
With the 585-page withdrawal agreement dealt with among negotiators and a vague statement on future relations both ready to be rubber-stamped on Sunday, Spain belated demands on Gibraltar had been taking center stage.
Portugal's foreign minister said Saturday that he backed the Brexit deal, including Spain's request to have its say on Gibraltar's future.
Foreign Minister Augusto Santos Silva said the original Brexit guidelines laid out last year that included assurances to Spain that it could deal with London directly on the issue of Gibraltar were "wise."
France has equally referred to the strong wording in last year's guidelines as the basis for compromise.
At home in the U.K, May's plans for Brexit continued to run into trouble.
The deputy leader of the Democratic Unionist Party in Northern Ireland used a party conference speech to try to persuade her to change course Saturday
Nigel Dodds told the conference in Belfast her proposed Brexit agreement reached with the EU would leave the U.K. in a "pitiful and pathetic place."
The small DUP has an outsize role because its support has been crucial to May's shaky government, which doesn't enjoy a majority in Parliament.
The party is threatening to end its support over the Brexit plan favored by May. That would imperil May's already difficult challenge in winning parliamentary support for her proposal.