Who's had it longer? From AD711 to 1462 Gibraltar was under Moorish rule, like most of Spain. Spain (initially Castile) controlled the territory from 1462 to 1704. Its political status between 1704 and 1713 was that of a territory occupied by allied Anglo-Dutch forces during the War of the Spanish Succession. Gibraltar's sovereign status between 1713 and 1880 was that of a territory taken by right of conquest, but legitimised in the form of a cession to the British (Article X, Treaty of Utrecht, 1713, Appendix I). Anglo-Dutch forces captured the fortress of Gibraltar in 1704, during the War of the Spanish Succession. It was formally ceded to the British in perpetuity under Article X of the Treaty of Utrecht in 1713. The Gibraltar territory was designated a Crown Colony in 1830 and was listed as such by the UN in 1946. In 1964, the Gibraltar Constitution was introduced and promulgated in 1969, stipulating that sovereign status would not be changed without the consent of Gibraltar's people.

What's the geography?

What's the legal position? Spain believes Gibraltar was taken in the context of a Spanish dynastic dispute and contests UK sovereignty over the entire peninsula. It also insists the cession in the Treaty of Utrecht 1713 did not include the isthmus with the airport on it and territorial waters. Spain cites the UN principle of territorial integrity, through UN Resolution 1514 (XV) - which says "any attempt at the partial or total disruption of the national unity and the territorial integrity of a country is incompatible with the purposes and principles of the Charter of the United Nations". It also argues two resolutions passed in the 1960s under the UN Principles of Decolonisation - (2231 (XXI), Question of Gibraltar and 2353 (XXII), Question of Gibraltar), mean territorial integrity takes precedence over Gibraltar's right to self-determination. The UK notes that Gibraltar was ceded by Spain in the Treaty of Utrecht 1713, giving "the full and entire propriety of the town and castle of Gibraltar, together with the port, fortifications, and forts there unto belonging... forever, without any exception or impediment whatsoever". It cites longevity of occupation, and argues the UN principle of territorial integrity, as per UN Resolution 1514 (XV) does not override the principle of self-determination. The same resolution says: "All peoples have the right to self-determination; by virtue of that right they freely determine their political status." "Gibraltar is much bigger than it was in 1713 - some of the runway and housing on the west side is built on reclaimed land, and the Treaty says nothing about reclaimed land, or territorial waters," says Dr Chris Grocott, lecturer in economic history at Leicester University.

What about self-determination? Spain also argues two resolutions passed in the 1960s under the UN Principles of Decolonisation do not recognise Gibraltar's right to self-determination. It says Resolution 2231 focuses on the "interests" and not the "wishes" of the people of Gibraltar. Dr Gerry O'Reilly, a senior lecturer in geography and international affairs at Dublin City University, says up to the 1990s, Spain viewed the population of Gibraltar as "a community artificially created from heterogeneous origins since 1713 by colonial processes" rather than indigenous, and therefore thought it did not fulfil criteria for any form of nationhood that could be interpreted as giving a right to UN "national'" self-determination principles. However, since 2002 Spain has offered the people of Gibraltar the constitutional status of an autonomous region/community within the Spanish state, he says. There was a referendum in Gibraltar in 1967, which called on both Spain and the UK to take into account the "interests" of the people of Gibraltar. In it 12,138 of the 12,237 voters chose "voluntarily to retain their links with the UK". The referendum was condemned by the UN General Assembly, and not recognised by any international body or state. The UK promulgated the Gibraltar Constitution Order in 1969, in which it was stated that: "Her Majesty's government will never enter into negotiations under which the people of Gibraltar would pass under the sovereignty of another state against their democratically expressed wishes." Gibraltar's view: In the 2002 sovereignty referendum, voters overwhelmingly rejected a plan to share sovereignty over Gibraltar between the UK and Spain. Gibraltar believes the right of self determination was given to it by the UK in 1960, and that the UN Charter enshrines the right to self-determination of all colonial peoples.

What about Ceuta and Melilla? Spain says the situation with Ceuta and Melilla is completely different from that of Gibraltar. Both territories are part of Spain itself, not an Overseas Territory like Gibraltar. Both have been in Spanish hands since the 16th Century, centuries before the modern state of Morocco was born. Spain claims them on historical grounds, for national security reasons and UN territorial integrity of the state principles. It stresses the majority of residents are Spanish. But O'Reilly says any lasting resolution of Spanish and UK sovereignty issues must also take cognizance of the Spanish-Moroccan territorial dispute on the southern shore. For Morocco, resolution of the Anglo-Spanish issue should set a precedent for a resolution of the Moroccan-Spanish sovereignty dispute in relation to the Plazas. Spain retains five territories in north Africa - Ceuta, Melilla, Penon de Velez de la Gomera, Alhucemas and the Chafarinas Islands. Ceuta and Melilla are the most famous. Both are claimed by Morocco, which has compared the situation to Spain's claim to Gibraltar. Both territories are on the Moroccan coast. The population of both Ceuta and Melilla wish to remain Spanish. Morocco argues that the UN principles of decolonisation must be applied; that Spanish military bases there threaten Moroccan security; and that the UN territorial integrity principles also apply. But, despite the strong parallel, the UK doesn't bring up Ceuta and Melilla to reinforce the case for the continuation of the status quo for Gibraltar.

Are there any other underlying reasons? Some have suggested Spain is looking to divert attention from its own economic woes, or to use the possible new restrictions to give itself a bargaining chip. Spain has denied this. It has accused Gibraltar of being a corporate tax haven, allowing companies and wealthy individuals to avoid paying millions. Spain also believes the border is being abused and draining Spanish resources. Smuggling - cigarette smuggling in particular - is one bugbear, as is the alleged circumventing of Spanish residency taxes. Fishing rights are another point of contention, with both sides complaining about incursions. Although Gibraltar is small, it is strategically important, standing at the mouth of the Mediterranean. O'Reilly argues its location on the Strait gives it access to one of the three most vital arteries in the world in terms of commercial shipping, oil transportation and military-related transport. The UK's military base has historically been of huge significance - controlling virtually all naval traffic in and out of the Mediterranean Sea and Atlantic in WWII. The naval dockyard once dominated the economy. But according to Grocott, Gibraltar is now less militarily significant. Tourism is one of the four sectors that dominate the economy today - with most visitors coming from the UK. Then there's the tax system which has attracted financial services firms.

What do leaders say? Spanish PM Mariano Rajoy has said he hopes talks with the UK will end the current row over Gibraltar but he's prepared to "take legal measures to defend the interests of Spanish citizens". Spanish Foreign Minister Jose Manuel Garcia-Margallo has declared "the party's over". He threatened to charge motorists 50 euros (£43) for crossing the border, impose flight restrictions and investigate the tax status of 6,000 Gibraltarians who have properties in Spain. On recent occasions new, rigorous border checks have resulted in six-hour queues. There have also been reports that Spain may take the row to the UN. Prime Minister David Cameron has said he is very clear that the UK "will always stand up for the people of Gibraltar". He said a phone conversation with Spanish PM Mariano Rajoy over the Gibraltar border checks delays row was "constructive", and he had called because of "serious concerns". Gibraltar's view: Gibraltar's chief minister Fabian Picardo has accused Spain of "sabre-rattling like North Korea".