|There is evidence of human habitation in Gibraltar going as far back as Neanderthal man, an extinct species of the Homo genus. The first historical people known to have settled there were the Phoenicians around 950 BC. Semi-permanent settlements were later established by the Carthaginians and Romans. After the collapse of the Roman Empire, Gibraltar came briefly under the control of the Vandals, and would later form part of the Visigothic Kingdom of Hispania until its collapse due to the Muslim conquest in 711 AD. At that time, Gibraltar was named as one of the Pillars of Hercules, after the legend of the creation of the Straits of Gibraltar.
On April 30, 711, the Umayyad general Tariq ibn Ziyad led a Berber-dominated army across the Strait from Ceuta. He first attempted to land at Algeciras but failed. Subsequently, he landed undetected at the southern point of the Rock from present-day Morocco in his quest for Spain. Little was built during the first four centuries of Moorish control.
The first permanent settlement was built by the Almohad Sultan Abd al-Mu’min, who ordered the construction of a fortification on the Rock, the remains of which are still present. Gibraltar would later become part of the Kingdom of Granada until 1309, when it would be briefly occupied by Castilian troops. In 1333, it was conquered by the Marinids who had invaded Muslim Spain. The Marinids ceded Gibraltar to the Kingdom of Granada in 1374. Finally, it was reconquered definitively by the Duke of Medina Sidonia in 1462, ending 750 years of Moorish control.
In the initial years under Medina Sidonia, Gibraltar was granted sovereignty as a home to a population of exiled Sephardic Jews. Pedro de Herrera, a Jewish converso from Córdoba who had led the conquest of Gibraltar, led a group of 4,350 Jews from Córdoba and Seville to establish themselves in the town. A community was built and a garrison established to defend the peninsula. However, this lasted only three years. In 1476, the Duke of Medina Sidonia realigned with the Spanish Crown; the Sefardim were then forced back to Córdoba and the Spanish Inquisition. In 1501 Gibraltar passed under the hands of the Spanish Crown, which had been established in 1479. Gibraltar was granted its coat of arms by a Royal Warrant passed in Toledo by Isabella of Castile in 1501.
The naval Battle of Gibraltar took place on April 25, 1607 during the Eighty Years’ War when a Dutch fleet surprised and engaged a Spanish fleet anchored at the Bay of Gibraltar. During the four-hour action, the entire Spanish fleet was destroyed.
During the War of the Spanish Succession, British and Dutch troops, allies of Archduke Charles, the Austrian pretender to the Spanish Crown, formed a confederate fleet and attacked various towns on the southern coast of Spain. On 4 August 1704, after six hours of bombardment starting at 5 a.m., the confederate fleet, commanded by Admiral Sir George Rooke assisted by Field Marshal Prince George of Hesse-Darmstadt comprising some 1800 Dutch and British marines captured the town of Gibraltar and claimed it in the name of the Archduke Charles. Terms of surrender  were agreed upon, after which much of the population chose to leave Gibraltar peacefully.
Franco-Spanish troops failed to retake the town, and British sovereignty over Gibraltar was subsequently recognised by the 1713 Treaty of Utrecht, which ended the war. In this treaty, Spain ceded Gibraltar (Article X) and Minorca (article XI) to the United Kingdom in perpetuity. Great Britain has since retained sovereignty over the former ever since, despite all attempts by Spain to recapture it.
Due to military incursions by Spain various fortifications were established and occupied by British troops in the area which came to be known as “the British Neutral Ground.” This was the area to the north of Gibraltar, militarily conquered and continuously occupied by the British except during time of war. (The sovereignty of this area, which today contains the airport, cemetery, a number of housing estates and the sports centre, is separately disputed by Spain.)
During the American Revolution, the Spanish, who had entered the conflict against the British, imposed a stringent blockade against Gibraltar as part of an unsuccessful siege (the Great Siege of Gibraltar) that lasted for more than three years, from 1779 to 1783. On 14 September 1782, the British destroyed the floating batteries of the French and Spanish besiegers, and in February 1783 the signing of peace preliminaries ended the siege.
Gibraltar subsequently became an important naval base for the Royal Navy and played an important part in the Battle of Trafalgar. Its strategic value increased with the opening of the Suez Canal, as it controlled the important sea route between the UK and colonies such as India and Australia. During World War II, the civilian residents of Gibraltar were evacuated, and the Rock was turned into a fortress. An airfield was built over the civilian racecourse. Guns on Gibraltar controlled the entrance to the Mediterranean Sea, but plans by Nazi Germany to capture the Rock, codenamed Operation Felix, later named Llona, were frustrated by Spain’s reluctance to allow the German Army onto Spanish soil and the excessive price Franco placed on his aid. Germany’s Admiral Wilhelm Canaris, head of the Abwehr, also helped by filing a pointedly negative assessment of the options. Canaris was a leader of the German high command resistance to Hitler, and tipped off Franco who erected concrete barriers on roads leading to the Pyrenees.
In the 1950s, Spain, then under the dictatorship of Francisco Franco, renewed its claim to sovereignty over Gibraltar, sparked in part by the visit of Queen Elizabeth II in 1954 to celebrate the 250th anniversary of the Rock’s capture. For the next thirty years, Spain restricted movement between Gibraltar and Spain, in application of one of the articles of the Treaty. A referendum was held on September 10, 1967, in which Gibraltar’s voters were asked whether they wished to either pass under Spanish sovereignty, or remain under British sovereignty, with institutions of self-government. The vote was overwhelmingly in favour of continuance of British sovereignty, with 12,138 to 44 voting to reject Spanish sovereignty. This led to the granting of autonomous status in May 1969 , which the Government of Spain strongly opposed. In response, the following month Spain completely closed the border with Gibraltar and severed all communication links.
The border with Spain was partially reopened in 1982, and fully reopened in 1985 prior to Spain’s accession into the European Community. Joint talks on the future of the Rock held between Spain and the United Kingdom have occurred since the late 1980s, with various proposals for joint sovereignty discussed. However, another referendum organised in Gibraltar in 2002 rejected the idea of joint sovereignty by 17,900 (98.97%) votes to 187 (1.03%). The British Government restated that, in accordance with the preamble of the constitution of Gibraltar, the “UK will never enter into arrangements under which the people of Gibraltar would pass under the sovereignty of another state against their freely and democratically expressed wishes.” The question of Gibraltar continues to affect Anglo-Spanish relations.
In 1981 it was announced that the honeymoon for the royal wedding between prince Charles and Diana Spencer would start from Gibraltar. The Spanish Government responded that King Juan Carlos and Queen Sofia had declined their invitation to the ceremony as an act of protest.
In 1988, SAS troops shot and killed three members of the IRA who were planning an attack on the British Army band. The ensuing “Death on the Rock” controversy prompted a major political row in the UK.
2006 saw representatives of the United Kingdom, Gibraltar and Spain conclude talks in Córdoba, Spain, a landmark agreement on a range of cross-cutting issues affecting the Rock and the Campo de Gibraltar removing many of the restrictions imposed by Spain. This agreement resolved a number of long standing issues; improved flow of traffic at the frontier, use of the airport by other carriers, recognition of the 350 telephone code and the settlement of the long-running dispute regarding the pensions of former Spanish workers in Gibraltar, who lost their jobs when Spain closed its border in 1969.