This week’s European territorial dispute is well away from the usual hotspots in the Balkans, even though it’s an issue of long standing. Britain and Spain have been trading barbs over the territory of Gibraltar, British for more than three hundred years but still a grievance from the Spanish point of view.

The immediate background is the creation recently of an artificial reef by the local Gibraltar government; the Spanish say that it is in a conservation zone and will disrupt fishing. But it’s inseparable from the fact that this is a very uncomfortable time to be a Spanish government, and prime minister Mariano Rajoy is desperately in need of a distraction from his economic and political troubles.

So the dispute has escalated, with Spain instituting additional checks at the Gibraltan border, which have led to serious delays. As is the way with these things, Spain denies they are a retaliation and says they are just designed to control smuggling. Britain has protested that Spain is violating the European Union’s guarantees of free movement – and on that aspect of the case at least, the British appear to have the law on their side.

As to the underlying dispute over sovereignty, things are a bit less clear. (The BBC has a good summary of the competing claims.) The Gibraltans overwhelmingly want to remain British, so if self-determination is key then Spain doesn’t really have a case. In that respect it is a similar position to that of the Falkland Islands, so it’s perhaps not surprising that Spain has aligned itself to some extent with Argentina.

But Gibraltar’s geographic position is rather different. The Falklands sit out in the South Atlantic Ocean; close to Argentina, but not geographically part of it. No-one, however, would think of Gibraltar as a separate territory if it didn’t have a border drawn around it. In purely geographic terms it is self-evidently part of Spain, so Spain’s argument from territorial integrity is much stronger than Argentina’s.

Unfortunately for the Spanish government, territorial integrity (or “national unity”, as it’s sometimes called) is a risky ground for it to stand on, since it holds on to similar enclaves on the other side of the straits, notably Ceuta and Melilla. If Spain is entitled to claim Gibraltar, then Morocco has an equally strong claim on Ceuta and Melilla.

Moreover, Gibraltar has what the Falklands lack, namely an explicit renunciation of claims by the neighboring power. In 1713, in the Treaty of Utrecht – nine years after the British had seized the peninsula during the War of the Spanish Succession – Spain ceded it “for ever, without any exception or impediment whatsoever.”

Subsequent attempts in the eighteenth century to regain it, as well as more peaceful efforts since the mid-twentieth century, demonstrate that Spain no longer considers itself bound by that renunciation. And these days we no longer recognise territorial claims based on conquest, even if the conquest is then ratified by the defeated power. Nonetheless, three hundred years is a long time, and if questions settled for that long are to be reopened there are very few countries that would be unaffected.

It’s also worth thinking about the other very big difference between Gibraltar and the Falklands. Britain and Argentina actually went to war in 1982, but war between Britain and Spain has for much longer than that been unthinkable. Despite this week’s provocations, it still is. And that’s despite the fact that Gibraltar is much more strategically important than the Falklands are ever likely to be.

For all their mutual indignation, Britain and Spain remain allies, partners in NATO, the EU and a web of other relationships. Developed democracies simply don’t go to war over issues like this: either they compromise, or they learn to just live with their differences.

Perhaps one day some sort of agreed solution will be found to the Gibraltar question, but if so it is likely to be a long way off. In due course, however, both Britain and Spain will realise that the state of tension isn’t getting them anywhere and will find other things to worry about.