Spanish Primer Minister Pedro Sanchez, center, left, and British Prime Minister Theresa May at the European Council summit in Brussels | Ben Stansall/AFP via Getty Images Gibraltar Brexit deal done, says Spain’s Sánchez Spain has not renounced its claim to retake sovereignty over the disputed territory.

MADRID — The U.K. and Spain have come to a Gibraltar Brexit deal, according to Spain's prime minister, although some key aspects of relations post Brexit are still to be settled.

Speaking to reporters following the European Council summit in Brussels on Thursday, Pedro Sánchez said that the protocol on Gibraltar, to be attached to the Withdrawal Agreement between the U.K. and the EU, “is already closed with the British government.”

The document is set to regulate the status of Gibraltar — a British overseas territory in the south of Spain that Madrid ceded to Britain in 1713 — during the transition period after the U.K. leaves the EU next year.

Similar protocols are expected on Northern Ireland and on U.K. military bases in Cyprus, assuming an overall divorce deal can be done.

Neither Sánchez nor other members of his Cabinet have publicly given details on the contents of the document, but have emphasized that the agreement prevents Gibraltar from becoming an obstacle to the wider EU-U.K. negotiation on Brexit.

“Those issues on which we don’t agree on will be left for the transition period" — Josep Borrell, Spanish foreign minister

“If the Brexit agreement needs to be signed tomorrow, it will be signed and Gibraltar won’t be a problem,” Foreign Minister Josep Borrell told lawmakers in Congress on Wednesday. He added that he had ordered Spanish negotiators not to let the protocol be changed “over their dead bodies.”

The European Council’s guidelines for Brexit negotiations with the U.K. gave Madrid de facto veto power over whether the final agreement is applied to Gibraltar.

A Spanish diplomat who has been part of the negotiating team with the U.K. said the protocol was sent to the EU’s chief negotiator Michel Barnier earlier this month. It states that Gibraltar will be covered by the Withdrawal Agreement, and essentially respects the status quo.

The diplomat also said that the document contains specific clauses on citizens' rights (particularly non-British citizens living in Spain and working in Gibraltar) and makes reference to a series of Memorandums of Understanding (MoUs) on a number of issues.

These MoUs are being negotiated separately between London and Madrid and will not form part of the Brexit agreement. They cover the environment, tobacco smuggling, security cooperation, citizens’ rights and taxes, which are long-term grievances of Madrid's.

Another controversial question — the joint use of Gibraltar airport — has been dropped from the negotiation, Sánchez said Thursday, meaning the British overseas territory will continue operating the facility singlehandedly.

Borrell on Wednesday said four of those MoUs — all but the one on Gibraltar's tax regime — are almost done. A British official confirmed that view but added that there are still some details pending on the issue of tobacco.

“Both [British Prime Minister Theresa] May and myself have set ourselves to reach an agreement on those MoUs,” Sánchez said, adding that the tax regime is the one of “most sensitive issues when it comes to Gibraltar.”

In any case, both Sánchez and Borrell have publicly lowered the pressure to reach a deal on the MOUs. “Those issues on which we don’t agree on will be left for the transition period … because Brexit doesn’t need the MOUs,” Borrell said Thursday.

Yet the fact that the protocol on Gibraltar doesn’t fully address Spanish grievances over the disputed territory raises questions over the Spanish legal leverage to enforce those MoUs — or even to ensure London signs them at all — once a Brexit deal is done.

“Let no one have fear … we don’t have any interest in complicating the life of anyone, we don’t want to close fences, we don’t want to make things difficult" — Josep Borrell

Spain’s foreign ministry on Thursday didn’t immediately respond to POLITICO’s question on the issue.

“There is now a fairly final protocol on Gibraltar which will be a part of the Withdrawal Agreement,” Chief Minister of Gibraltar Fabian Picardo said in a statement.

Spain considers Gibraltar a colony and hasn’t renounced its claim to retake sovereignty over it in the long term, yet this question has been absent from the Gibraltar negotiation, according to Borrell. But he said that Gibraltar will leave the EU next year, meaning “it’s in its interest to get closer to Spain … and we must build bridges to advance into shared sovereignties in the right moment.”

“We want a more balanced relationship with Gibraltar and offer Gibraltarians a closer relationship with Spain for their own benefit and that of the surrounding [Spanish] area,” he continued. “Let no one have fear … we don’t have any interest in complicating the life of anyone, we don’t want to close fences, we don’t want to make things difficult.”

A spokesperson for the U.K. government said: "There have been positive and constructive negotiations taking place. While discussions are still in progress, we are hopeful of reaching a resolution soon."

Eddy Wax and Charlie Cooper contributed reporting.