Image copyright EPA Image caption Gibraltar has been in British control for more than 300 years

A row over Gibraltar has broken out after the UK sent a letter formally triggering Brexit talks. But why have tensions risen over the Rock and why is it important?

Why is Gibraltar British?

Gibraltar, located at the bottom of Spain on the southern end of the Iberian Peninsula, was under the rule of the Moors - a group of Muslim inhabitants - from AD711 to 1462, like most of Spain.

Spain (initially Castile) controlled the territory from 1462 to 1704.

In 1704 it was seized by an Anglo-Dutch force from Spain before being ceded to Great Britain in 1713 and has remained a UK territory ever since.

Totalling 2.3-sq-mile (5.9 sq-km) in land mass, the territory is dominated by the 1,300ft high (397m) limestone Rock of Gibraltar.

What does Spain say... and Gibraltarians?

Spain believes Gibraltar was taken in the context of a Spanish dispute over who should inherit the crown.

The UK notes Gibraltar was ceded by Spain in the Treaty of Utrecht and points to the fact it has occupied the land for longer.

Both countries cite UN principles as supporting their claims.

Gibraltar - a territory with a population of 32,000 - believes it has the right of self determination - something Spain disputes.

Gibraltarians are British citizens and rejected by 99% to 1% the idea of the UK sharing sovereignty with Spain in a vote in 2002 and in a previous referendum in 1967.

Why is it important?

Although Gibraltar is small, it is strategically important because of its location, standing only 12 miles from the north coast of Africa.

The UK has a military base there, including a port and airstrip. It was an important naval base during World War Two.

Gibraltar's location on the Strait also gives it important access to commercial shipping, oil transportation and military-related transport.

Spain has accused Gibraltar of being a corporate tax haven, allowing companies and wealthy individuals to avoid paying millions.

Image copyright AFP Image caption Gibraltarians voted overwhelmingly to remain in the EU

Fishing rights are another point of contention, with both sides complaining about incursions.

Although it is part of the EU, Gibraltar is outside the VAT area and the customs union - a group of states that have agreed to charge the same import duties as each other and usually allow free trade between themselves.

This means it is free to to set its own tariffs on goods imported from outside the EU.

Spain also believes the border is being abused and draining Spanish resources, with the smuggling of cigarettes being a particular bugbear.

What's the latest spat all about?

Following the triggering of formal Brexit negotiations, it was revealed the EU's draft document on its Brexit strategy said no agreement on its future relationship with the UK would apply to Gibraltar without the consent of Spain - giving it a potential veto.

Spain - a member of the EU - reportedly lobbied for the condition.

Gibraltar, which voted by 96% to stay in the EU in June's referendum, accused Spain of using Brexit to pursue its territorial aims.

Some have criticised the UK government for not mentioning Gibraltar in its 2,200-word letter triggering Article 50, but ministers have said the territory is referred to in another document and have stressed their commitment to protecting the interests of the territory.

UK Foreign Secretary Boris Johnson said the "sovereignty of Gibraltar is unchanged and is not going to change".

Spain said it had been "surprised by the tone of comments coming out of Britain" about Gibraltar.