Ashley Fox is an MEP for South West England, and is the leader of Britain’s Conservative MEPs.

On Sunday morning voters in the Spanish region of Andalucia went to the polls with the words of Pedro Sanchez, the Prime Minister, about Gibraltar fresh in their minds.

Sanchez had boasted that the Political Declaration agreed by the EU27 in Brussels a week earlier meant Gibraltar’s sovereignty was back on the agenda and that he was “going to resolve a conflict that has been going on for over 300 years.”

It was empty rhetoric, but Sanchez clearly hoped that a dose of nationalistic tub thumping would help see off the rising Vox Party.

The tactic failed. Twenty four hours later it was clear that support for his Spanish Socialist Workers’ Party had collapsed in an area it had ruled since 1982, while right-wing Vox took 12 seats in its first success at the ballot box.

As an MEP for Gibraltar, I hope the weekend’s events have convinced Sanchez that making undeliverable promises on Gibraltar is not going to help his struggling government. The territory’s sovereignty is not, and never has been, on the agenda, and nothing in the Withdrawal Agreement changes that.

As for his claim that the Political Declaration excludes Gibraltar from future UK/EU agreements without Spain’s express consent, that too is smoke and mirrors.

The British Government has been clear throughout the Brexit process that it will negotiate the future relationship on behalf of all territories for which it is responsible. Under EU rules trade deals require the unanimous support of all member states and Spain, like every other country, will have a veto on the eventual UK/EU agreement. But that does not mean, as Sanchez has suggested, that it will be able to cleave Gibraltar way from the UK.

Instead of fostering division in the vain hope of electoral gain, the Spanish Prime Minister should resume the co-operation which produced real benefits for both Spaniards and Gibraltarians in the form of memoranda of understanding attached to the Withdrawal Agreement.

Covering citizens’ rights, tobacco, the environment, and police and customs co-operation, the memoranda are time-limited until the end of the implementation period. A further agreement on taxation and the protection of financial interests is expected to be concluded shortly. Amongst other things, they recognise the importance of free movement continuing during the implementation period, which is of particular importance to Spain as thousands of Spaniards cross the border each day to work in Gibraltar. They also crack down on the illicit trade in tobacco, alcohol and petrol.

The memoranda were approved by the Government of Gibraltar and have been described by Fabian Picardo, the Chief Minister, as “safe, sensible and secure” measures that “deal with issues we are as concerned about as our neighbours.” They state explicitly that nothing in the agreements modifies issues of “sovereignty, jurisdiction or control.”

Before Sanchez changed his approach ahead of the poll in Andalucia Josep Borrell, the Spanish Foreign Minister, also spoke enthusiastically of the memoranda, tweeting: “These agreements are a good foundation for the negotiation on the future relationship and their application will generate benefits for citizens and a climate of better understanding.”

I would now urge Sanchez to return to this spirit of co-operation and explain to voters how he has secured practical gains for Spaniards living in depressed areas close to the Gibraltar border, and how continued closer ties could produce more.

I know Gibraltar and its people well and have worked closely with both Picardo and his predecessor Peter Caruana.

Gibraltarians may have voted heavily to remain in the EU, but their loyalty to the UK is much stronger. Remember that they endured 13 years of the border being closed under General Franco. The Chief Minister has said they will suffer any hardship rather than compromise on sovereignty. So although Gibraltar does not want to face a no deal situation, it is prepared to do so if it becomes necessary.

Spain needs to understand that and choose to build on the progress made in the last 18 months, not continue the fruitless posturing of the past fortnight.