European Council President Donald Tusk and Spanish Prime Minister Pedro Sanchez agreed to a deal Saturday on the future of Gibraltar, removing a key obstacle one day before a European Union meeting intended to endorse the Brexit deal.
Spain had demanded changes to the agreement and an accompanying declaration on a new EU-Britain relationship to clarify that the future of Gibraltar, which was ceded to Britain in 1713 but still is claimed by Spain, be decided in direct talks between Madrid and London.
Sanchez had warned he could boycott the summit on Sunday if London and EU member states did not confirm his country's right to a veto over any future accord involving Gibraltar.
The deal was reached after British and Spanish negotiators talked through the night with EU officials.
Sanchez said the deal "is going to allow us to have direct negotiations with the U.K. regarding Gibraltar'' and added Spain would vote in favor of Brexit.
British Prime Minister Theresa May said of the deal, "I will always stand by Gibraltar. The U.K. position on the sovereignty of Gibraltar has not changed and will not change."
EU head Jean-Claude Juncker said after meeting with Sanchez that solidarity and dialogue were "the European way of finding solutions."
Spain does not currently have veto power on the Brexit agreement, which does not have to be approved unanimously, but it would prevent any free-trade deal between Britain and the European Union, which would require the approval of all 27 EU member states.
The Brexit package is also facing strong opposition in the British parliament, which must vote in favor for it to take effect. Otherwise, Britain would leave the bloc on March 29, 2019, without an agreement to mitigate economic disruption.
As negotiators from EU member nations attended a pre-summit meeting in Brussels Saturday, May was scheduled to discuss the disputed British territory with Juncker and Tusk.
In an open letter published in the Sunday British newspapers, May made a direct appeal to Britons, asking them to support the deal to leave the EU, even though the support of her own Conservative Party seemed unsure.
"It will be a deal that is in our national interest — one that works for our whole country and all of our people, whether you voted 'Leave' or 'Remain,' " she said, adding she would campaign "heart and soul" to get her Brexit deal through Britain's Parliament.
Former British Foreign Secretary Boris Johnson called Saturday for the appointment of a minister to oversee preparations for a "no-deal" British exit from the EU.
"It is very important that we show we are negotiating with confidence and conviction and we have a new secretary of state with powers ...to make things happen and get this country ready if we have to go out on WTO (World Trade Organization) terms."
EU diplomats were hopeful a draft of the clause would be approved by late Friday. And they were concerned Sanchez would want to discuss the issue with top-level officials on Sunday in an attempt to show determination and to curry favor with voters before December's regional election.
The clause is seen by some experts as a major opportunity for Spain, one of whom is Ignacio Molina of the Elcano Royal Institute, a Madrid-based research organization.
"Madrid saw Brexit as an opportunity to reconfigure the status of the territory which is administered by the United Kingdom," Molina wrote on the Agenda Publica's website.
Molina wrote that Spain could go "all-out" and raise the issue of sovereignty or take a more modest approach to "resolve concrete problems in the areas of regulation, tax and cross-border freedom of movement."