A commercial ­dispute breaks out in the South Atlantic. ­Argentina asserts a hoary claim to the Falklands and takes it to the UN. Britain says push off, you must be joking. Nobody takes it ­seriously as war is inconceivable. ­Downing Street is more concerned with domestic unpopularity.

That was in March 1982. It was also last week. Then the tabloids greeted Argentina's claim with Stick It Up Your Junta. Now they are equally nuanced, calling the Argentine president, Cristina Kirchner, Queen Argie Bargy and Old Plastic Face. Then it took nine weeks of counter-invasion, with 1,000 deaths and £3bn spent, for Britain to restore the status quo ante. The Falklands war was a catastrophic failure of diplomacy and deterrence. Now, at least, war is unlikely.

Britain has almost as many troops on the islands, 1,200, as there were islanders at the time of the invasion. It is on guard and the latest row with Argentina is merely over the arrival of an oil rig, the Ocean Guardian, in waters north of Port Stanley. But Argentina regards submarine resources as falling within the terms of its long-standing claim to the islands, which its defeat in the 1982 war did nothing to diminish. Military conquest does not establish legal title.

Anyone who studies the tortuous ­history and law of the Falklands will know that Argentina's claim to the islands was certainly strong. The treaty of Utrecht recognised Spanish sovereignty and this led to 40 years of Spanish occupation of the islands, which was reasserted in 1823 by Buenos Aires after its independence from Spain. Ten years later the islands were seized by force by Britain, and settlers sent out in a crude act of imperial aggression.

Argentina protested its right to the islands then and since, regularly ­registering it with the UN's decolonisation committee, supported by other post-imperial states in south and north America. Thirty-two Latin American countries reasserted that support in Mexico this week with even the US sympathetic, conspicuously refusing to side with Britain on what it too sees as a post-imperial issue.

Britain's defence is one of "prescription"; that Britons have been in uninterrupted occupation of the islands since the 19th century, backed up by the oft-proclaimed wish of these Britons not to become Argentinian. Such considerations are strong, if not overwhelming, in international law. They were why the UN security council approved Britain's military reversal of the 1982 invasion.

But legal title is not all. The Falklands are the Elgin marbles of diplomacy, perhaps trivial to London but subject of everlasting (if minor) grievance to the people of Argentina. Before 1982 Britain recognised this. The islands lay off the coast of Argentina – their obvious link to the outside world. Continuing to garrison and supply them from Britain was an expensive legacy of empire.

Indeed at the very time of the Falklands war, Margaret Thatcher was transferring Hong Kong to China on similar grounds of expediency, and her favourite minister, Nicholas Ridley, was seeking a negotiated compromise on the Falklands with Argentina at the UN. This was for a transfer of sovereignty over the islands to Buenos Aires with entrenched leaseback to Britain to administer them on behalf of the 1,800 islanders, who would retain their right to remain British.

The irony is that the one thing that might have made leaseback acceptable to the islanders – a democratic Argentina – came about only through the one event that made such confidence-building impossible, the Falklands war. But that was the short-term. The short-term cannot be the end of the matter.

Argentina has not threatened military action over the Ocean Guardian, nor is President Kirchner's protest necessarily a bid for popularity – the Malvinas are not a big issue in Buenos Aires politics. Britain's decision to go ahead with drilling, though within the bilateral 1995 Joint Declaration over Oil, was bound to be seen in Latin America as imperial arrogance. The matter may yet be decided by the international court at The Hague.

The right to self-determination of the islanders – long the obstacle to any deal with Argentina – has to be qualified. Intransigent in their response to the Ridley negotiations and backed by ­neo-imperialist rightwingers in the House of Commons, the islanders demanded and got their rescue by the 1982 task force and extravagant support ever since. They have rebuffed all efforts by later Buenos Aires mediators to ­re-establish contact.

The islanders claim that the cost of sustaining their splendid isolation can be met from the potential revenue from oil. But that oil no more belongs to them than the revenue of North Sea oil belongs to the Orkneys. As for potential oil farther south, uninhabited South Georgia and the South Orkneys can hardly claim "self-determination" to justify Britain appropriating revenue there, which many in South America consider theirs.

Democratic consent is always ­important, though hardly an absolute. Britain never gave the Hong Kong islanders a say in whether they would be handed over to Beijing. The fate of Gibraltar cannot be delegated entirely to the Gibraltarians. There is fierce opposition among English political parties to allowing the Scots even to vote on whether or not to end their union with England. There is nothing special about the Falklands.

In other words, 2,500 colonists cannot enjoy an unqualified veto on British government policy. Thatcher thought it was in Britain's interest to negotiate with Argentina in 1982, even when it was a dictatorship. Now that Argentina is a democracy that interest can hardly have diminished. Subsequent British governments knew this, but were too gutless to act on it. The Falklands will remain an expensive nuisance to British diplomacy – and possibly trade – in Latin America, the more so after last week's vocal support for Kirchner in Mexico.

The best hope for a ­stable and prosperous Falklands under British occupation is a revival of leaseback under UN supervision. The islands must have links with the adjacent mainland. It is absurd to supply them for ever by an air bridge from Britain and ­Ascension. Nor should the security of British citizens necessarily entitle them to the ­exploitation of oil on South America's continental shelf.

Britain was very lucky to win the Falklands war. Had a freelance navy occupation of South Georgia not ­pre-empted a planned later invasion, and had America not overtly and ­covertly backed the British task force, Thatcher's desperate gamble might have failed and the Argentine occupation succeeded, like India's seizure of ­Portuguese Goa which it imitated. (It was even called Plan Goa.)

That war is unlikely to be repeated. But this cannot allow us to ignore its causes. Distant colonies are a post-imperial anachronism. Britain will have to negotiate with Argentina because the world, either at the UN or at The Hague, will insist on it. The government and media can bury their heads in the sand, but that will not make the Falklands dispute go away or atone for the dead of the silliest of wars a quarter century ago.