As celebrations to mark the 300th anniversary of British rule in Gibraltar provoke a diplomatic row with Spain, Nick Morrison looks at the history of this 'stone in the shoe' of our relations with an EU partner - and asks if colonies have any place in a 21st century world.

FOR hundreds of years, the great powers of Europe fought a seemingly never-ending battle for territory. The Thirty Years' War, the Seven Years' War, the War of the Spanish Succession, the War of the Austrian Succession. Even Jenkins' Ear got its own war.

Whether it was religion, trade, dynastic ambition or personal insult, there was always a reason to go to war. But at the root of them all was the acquisition of land and the belief that this would bring both influence and money. In short, territory equalled power.

Today, such concepts are seen as relics of another era, a time when power was a matter of survival and survival was a matter of building your own empire before you found yourself part of someone else's. Now, the European democracies have no need to fear for their existence, their boundaries are undisputed and the territorial disputes are all settled. All except one.

The object of this last power struggle covers just two-and-half square miles, contains just 27,000 people and its most distinctive feature is that it is home to Europe's only indigenous monkeys. But it is also a running sore, poisoning relations between two of the European Union's big guns, Britain and Spain.

Yesterday saw the sore weeping once more, as Defence Secretary Geoff Hoon's decision to attend the celebrations marking 300 years of British rule in Gibraltar was criticised as "offensive" by Spanish MPs, and Britain was accused of clinging to its imperial past.

In response, some 12,000 Gibraltarians linked arms to form a human chain around the Rock, in a show of defiance to the Spanish.

It was during one of those interminable 18th century wars - this one that of the Spanish Succession - that Gibraltar was captured from the Spanish by an Anglo-Dutch fleet in 1704. Nine years later, in the Treaty of Utrecht, the peace settlement which formally brought that war to a close, the rocky promontory was officially ceded to the British.

At the crossroads of the Mediterranean and the Atlantic Ocean, Gibraltar possessed an importance far in excess of its size and had a significance even to the Ancient World. The Romans referred to the Straits of Gibraltar as "ne plus ultra" - go no further.

It was the Arabs who gave the Rock its name. When the Moors swept across North Africa and into Spain, their commander Tariq Ibn-Ziyad realised its military value and turned it into a fortress in 711. Tariq's mountain, or Gebel Tarik in Arabic, was to later become Gibraltar.

It was not until Ferdinand and Isabella drove the Moors out of Spain that Gibraltar finally came under Spanish ownership, in 1501, allowing supporters of British sovereignty to crow that it has been in British hands longer than it has been Spanish.

But the Spanish have refused to let it go without a fight, and have mounted a succession of attempts to regain it, most notably the four-year Great Siege, which ended in 1783.

Gibraltar became a British colony in 1830, but its population has largely been drawn from southern Europe and North Africa, with Genoese, Portuguese, Maltese, Moroccan and Spanish well represented. But this has not stopped Britain's determination to cling onto it, with its strategic importance underlined by its use in anti-submarine warfare of the First and Second World wars.

This insistence on retaining sovereignty ensured it remained a sore point between the two countries throughout the 20th century. In the 1940s, Spanish dictator General Franco closed the border, and again in 1969, this time not to be reopened fully until 1985.

Despite repeated attempts to resolve the issue, from the 1963 UN Special Committee on Decolonisation to the 1984 Brussels Process, it has remained intractable, not least because of the intransigence of the Gibraltarians themselves. Despite their mixed heritage, the people of Gibraltar have consistently voted to remain under the British umbrella. A referendum in 1967 found 12,138 voting to remain a British colony, while just 44 wanted to return to Spain. An unofficial poll held two years ago, when the British Government signalled that it wanted to share sovereignty with Spain, found 17,900 against, and just 187 in favour.

Despite Mr Hoon's presence on the Rock yesterday, it seems clear that Tony Blair's government is eager to reach a settlement with the Spanish, but is hindered by a commitment in Gibraltar's 1969 constitution, which stated that it would not pass into another state's sovereignty against the wishes of its inhabitants. Independence is also out, under a clause in the Treaty of Utrecht which states that if Britain ever relinquishes sovereignty, it has to give Spain first refusal.

But if this vestige of colonialism sits uncomfortably with the notion of a mature democracy which does not need to resort to territorial ambitions to prove its worth, it is not just Britain which is at fault. Spain has refused to release its hold on the enclaves of Cueta and Melilla off the Moroccan coast, even occupying one of the disputed islands in recent years to underline its possession.

And nor is Gibraltar the only colony which has caused difficulty. Even though Hong Kong was handed back when Britain's 99-year lease came to an end, and without taking the wishes of its population into account, it was a frequent source of friction with China. Britain proposed leasing the Falkland Islands to Argentina, but the islanders rejected the plan and war with Argentina followed. A more straightforward solution was found for the island of Diego Garcia in the Indian Ocean, whose inhabitants were simply removed to make way for a US air base.

Perhaps the only solution to the Gibraltar problem lies in the actions of a detachment of commandos two years ago. The 20 Royal Marines managed to establish a bridgehead on the beach at La Linea de la Concepcion, before it was pointed out to them that Gibraltar was a few miles along the coast and they had accidentally invaded Spain. They looked at their maps and jumped back in their landing craft, but perhaps if they had continued, there would no longer be any dispute over the Rock.