The historical development of these walled medina’s is multi-layered and has been established by many influences, such as Carthaginian, Phoenician, Byzantines, Berber, Banu Arous tribe, Roman, Goths, Vandal, Normans, Arabs, Almohaden, Meriniden, Wattasiden, Saaidi, Alaouiten, Portuguese, English, French, and Moroccan.
The influence of Europe (especially Portugal, Spain, and France) on the (historical) development and urban morphology on a large number of places on the Moroccan Mediterranean and Atlantic coastline, are undeniable and in some cases are even nowadays clearly visible. For example, since 1497 and 1668 respectively, ‘Melilla’ (a territory measuring 12.3 km2) and ‘Ceuta’, (19 km2), form the Spanish enclaves of the Moroccan coast.
The Portuguese layer is probably the best described in literature. Altogether, the Portuguese are documented to have seized 6 Moroccan cities and built several stand-alone fortresses on the Moroccan Atlantic coast, between the river Loukos in the north and the river of Sous in the south. The 6 cities were: Ceuta (1415–1668), Tanger (1471–1661), Asilah (1471–1549), Ksar es-Seghir (1458–1550), Azemmour (1513–1541) and Safi (1488–1541). In some cases, castles were built immediately, such as in Graciosa (Larache) in 1489, Santa Cruz do Cabo de Guer (Agadir) in 1505; Mogador (Essaouira) in 1506; probably in Ben Mirao (Immourane, between Santa Cruz and the cape itself) in 1507; Mazagão (El Jadida) in 1514, and Aguz (Souira Qedima) in 1519. There was also an unsuccessful attempt to conquer ‘S. João de Mamora’ (El-Mehdiya) in 1515, as well as the failed plan for the establishment of ‘Anafé’ (Casablanca), back in the late 1460s.