Having once been the site of a Phoenician port, the settlement of Asilah was established by the Idrisids at some point in the 8th Century AD as a fortress to protect coastal trade. Around 860 Bjorn Ironside and his brother (or perhaps half-brother) Hastein led a fleet of 62 longships from the Viking settlement on the Loire to raid the Mediterranean coasts. The voyage did not go well at first, with the fleet being defeated first by the Asturians, and then by the forces of the Caliphate of Cordoba. But the Vikings' looting was successful once they descended upon the town of Algeciras, and again when they reached Africa to ravage the coastal towns of the Idrisid caliphate and Umayyad towns on the Balearic Islands. While Asilah may have been spared (historians are uncertain), several attacks by Normans from Sicily during the 10th Century nearly eliminated what remained of the fortress town.