In 1087, the town was attacked by raiding ships from Genoa and Pisa who burned the Muslim fleet in the harbor. The attack played a critical role in Christians' seizure of control of the Western Mediterranean, which allowed the First Crusade to be supplied by sea. The Zirid dynasty had its residence here in the 11th century, but was brought to an end by the Norman conquest of the city in 1148. In 1160 the city came under Almohad rule.