The Rock has been fought over for centuries.
First it was Spain battling Moorish invaders. Then, after several hundred years, the Spanish lost Gibraltar to an Anglo-Dutch force in 1704.
The Spanish formally gave Gibraltar to Britain in the 1713 Treaty of Utrecht. But they have wanted it back ever since.
More recently the battles have been political. In 1984 the two governments started talks, but the process eventually collapsed over Madrid's demands that the Rock should become fully Spanish after 50 years of shared control.
In 1969 under General Franco, Spain cut Gibraltar off by sealing its border. This was eventually reopened in 1985, but there are long delays for anyone wanting to cross over.
Votes on the future of the Rock were held in 1967 and 2002. Gibraltarians ignored Spanish pressure and voted overwhelmingly to remain a British dependency.