The history of Gibraltar, a small peninsula on the southern Iberian coast near the entrance of the Mediterranean Sea, spans over 2,900 years. The peninsula has evolved from a place of reverence in ancient times into "one of the most densely fortified and fought-over places in Europe", as one historian has put it. Gibraltar's location has given it an outsized significance in the history of Europe and its fortified town, established in the Middle Ages, has hosted garrisons that sustained numerous sieges and battles over the centuries. Gibraltar was first inhabited over 50,000 years ago by Neanderthals and may have been one of their last places of habitation before they died out around 24,000 years ago. Gibraltar's recorded history began around 950 BC with the Phoenicians, who lived nearby. The Carthaginians and Romans later worshipped Hercules in shrines said to have been built on the Rock of Gibraltar, which they called Mons Calpe, the "Hollow Mountain", and which they regarded as one of the twin Pillars of Hercules. Gibraltar became part of the Visigothic Kingdom of Hispania following the collapse of the Roman Empire and came under Muslim Moorish rule in 711 AD. It was permanently settled for the first time by the Moors and was renamed Jebel Tariq – the Mount of Tariq, later corrupted into Gibraltar. The Christian Crown of Castile annexed it in 1309, lost it again to the Moors in 1333 and finally regained it in 1462. Gibraltar became part of the unified Kingdom of Spain and remained under Spanish rule until 1704. It was captured during the War of the Spanish Succession by an Anglo-Dutch fleet in the name of Charles VI of Austria, the Habsburg contender to the Spanish throne. At the war's end, Spain ceded the territory to Britain under the terms of the Treaty of Utrecht of 1713. Spain tried to regain control of Gibraltar, which Britain had declared a Crown colony, through military, diplomatic and economic pressure. Gibraltar was besieged and heavily bombarded during three wars between Britain and Spain but the attacks were repulsed on each occasion. By the end of the last siege, in the late 18th century, Gibraltar had faced fourteen sieges in 500 years. In the years after Trafalgar, Gibraltar became a major base in the Peninsular War. The colony grew rapidly during the 19th and early 20th centuries, becoming a key British possession in the Mediterranean.