MADRID — The Brexit headache has spread to Spain.

Spain's Socialist Prime Minister Pedro Sánchez has come under attack for failing to take back control of Gibraltar, with the conservative opposition accusing his Cabinet of wasting an opportunity thrown up by Brexit to achieve shared rule over the British enclave.

In the Spanish parliament on Wednesday, former Foreign Minister José Manuel García Margallo — a member of the main opposition Popular Party — hammered Foreign Minister Josep Borrell for failing to push for a deal based on “shared sovereignty,” “double nationality” and Spain assuming the “foreign relations” of Gibraltar — a British overseas territory in the south of Spain that Madrid ceded to Britain in 1713 but maintains it wants to recover in the long term.

“You’ve wasted a golden opportunity,” Margallo told Borrell.

The battle reflects how contentious the sovereignty of the small territory of 30,000 people is, not just between Spain and the U.K. but in Spanish politics. While the Rock had been absent from the Spanish political fight during the Brexit negotiations so far, the PP's attitude in recent weeks signals a tack change that will put pressure on Madrid to obtain diplomatic gains when the future relationship between the U.K. and the EU will be discussed — a development with the potential to stir trouble with Gibraltar, with London and with the EU at large.

"We’re facing a historic opportunity after three centuries … to decolonize the last colonial enclave left in Europe” — Pablo Casado, Popular Party leader

Margallo’s comments come two weeks after Prime Minister Sánchez announced Madrid and London have reached an agreement on a Gibraltar protocol to be attached to the divorce deal between the EU and the U.K. — assuming a deal can be reached — that will regulate the status of of the territory during the transition period after the U.K. leaves the EU in March 2019. The deal, he said, will prevent Gibraltar from becoming an obstacle to the wider Brexit negotiations.

National pride

The PP has zeroed in on the issue under the leadership of its new head, Pablo Casado, who is taking a hard stance on matters of national pride — including Catalonia, where he says Madrid should impose direct rule again — in an effort to attack Sánchez.

“The issue of Gibraltar is a red line for the Popular Party. We’re facing a historic opportunity after three centuries … to decolonize the last colonial enclave left in Europe,” Casado said in parliament last week. “There’s a proposal for shared sovereignty which is good for all sides.”

The Socialists hit back by pointing out that the previous administration — headed by conservative leader Mariano Rajoy — had already dropped the sovereignty claim during Brexit negotiations when Foreign Minister Alfonso Dastis took the reigns from Margallo in November 2016.

“The government’s policy on Gibraltar, the negotiating strategy, even the negotiating team, are exactly the same,” Borrell told Margallo on Wednesday. “If the PP has shifted positions by 180 degrees, you should start by acknowledging it.”

Indeed, after taking office in 2016, Dastis publicly discarded the plan to push for shared sovereignty of Gibraltar with the U.K., a position Margallo himself had advocated. Yet both Dastis and Borrell have argued that Spain will maintain its claim on the small peninsula in the longer term.

The idea of shared rule was discussed between former British Prime Minister Tony Blair and his Spanish counterpart José María Aznar in the early 2000’s — and was overwhelmingly rejected by the people of Gibraltar in a referendum in 2002.

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.

Old grievances

Speaking in Congress on Wednesday, Borrell gave fresh details on the Gibraltar protocol, which he said extends "the rights of frontier workers to seasonal workers" and regulates “the obligation by the U.K. to cooperate with Spain on matters of fiscal transparency” and “the application of international regulations on tobacco control.”

Borrell added that the deal excludes “Gibraltar from the civil legislation adopted during the transition period.” Asked for comment, a spokesperson for the foreign ministry said Borrell was referring to agreements on “civil aviation.”

The issue of the use of the Gibraltar airport is contentious and was dropped from the negotiations, meaning the British overseas territory will continue operating the facility singlehandedly.

London and Madrid are also negotiating a series of bilateral agreements addressing some grievances that Spain has levied against the Rock over the years, including the environment, tobacco smuggling, security cooperation, citizens’ rights and taxes, according to Borrell.

The negotiation of the future relationship between the EU and the U.K. will bring about new chances to tackle the situation of Gibraltar, Borrell argued. “We’ll have time and the occasion to propose many of the questions you’ve laid out,” he told Margallo.