The Murallas Reales (Royal Walls) de Ceuta were built as a system of coastal defence date from around 960AD and were still being improved in the 18th Century. Effectively dividing the area in two, the waterways are navigable by small boats and there are three bridges connecting the city. The area has been ‘visited’ over time by Carthage, Rome, Byzantium, Visigoths, Muslims, Berbers, Almohads, Tunisian Hafsids, Aragon, Portugal, and Spain to name a few. So it’s strategic position and sheltered port made it worth defending (and attacking!). Incidentally it is a possible site of one of Hercules’ pillars, standing opposite Gibraltar.
The capture of Ceuta by the Portuguese in 1415 began their global empire, which became the longest lived modern empire spanning nearly 600 years.