FILE PHOTO: People walk along a street in front of the Rock of the British territory of Gibraltar (rear), a monolithic limestone promontory, next to the border in La Linea de la Concepcion, southern Spain August 9, 2013. REUTERS/Jon Nazca/File Photo

MADRID (Reuters) - Spain will insist on excluding Gibraltar from all agreements between Britain and the European Union once Britain has left the European Union, Spanish diplomatic sources said on Tuesday.

Prime Minister Pedro Sanchez has said Spain intends to revive its bid for shared sovereignty over Gibraltar, a British territory since 1713, after Brexit.

“In every agreement reached with Great Britain there will be an asterisk which explains that the deal will not affect Gibraltar,” said a source.

Spain has long claimed sovereignty over Gibraltar, a rocky peninsula attached to southern Spain by a narrow causeway.

Gibraltar is due to leave the EU together with Britain, but Madrid’s claim to it has been boosted by the fact that 97 percent of its citizens voted to remain in the EU in Britain’s 2016 referendum on leaving Europe.

“After Brexit, Spain wants to include in writing in every document signed with the EU that it has nothing to do with Gibraltar, which should be based on a different relationship,” said the source. “This strategy will be followed in all agreements that will be signed.”

Britain’s parliament will vote on Tuesday on possible changes to the agreement reached by Prime Minister Theresa May on London’s exit from the EU, which was rejected last month by parliament.

The dispute between Madrid and London over Gibraltar had threatened to derail the Brexit negotiation process in November, but a last-minute deal cleared the way for the 27 EU states to approve the divorce package.