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 medieval times, 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.
While there are Spanish and British influences, a result of the territory's status as a British overseas territory and its proximity to Spain, the ethnic origins of most Gibraltarians are a mix of Andalusian Spaniards, Genoese, Maltese, Portuguese and British.