BRUSSELS (AP) – 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 UK 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 UK 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 favour of Brexit,” Sanchez said.

Sanchez said that the deal is “is going to allow us to have direct negotiations with the UK regarding Gibraltar.”

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 UK.”

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 centre 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 UK, 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 UK 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 favoured by May. That would imperil May’s already difficult challenge in winning parliamentary support for her proposal.

___

Joseph Wilson reported from Barcelona, Spain.

Follow Breitbart London on Facebook: Breitbart London