Zirid rule in Tripolitania was short-lived though, and already in 1001 the Berbers of the Banu Khazrun broke away. Tripolitania remained under their control until 1146, when the region was overtaken by the Normans of Sicily. It was not until 1159 that the Moroccan Almohad leader Abd al-Mu'min reconquered Tripoli from European rule. For the next 50 years, Tripolitania was the scene of numerous battles among Ayyubids, the Almohad rulers and insurgents of the Banu Ghaniya. Later, a general of the Almohads, Muhammad ibn Abu Hafs, ruled Libya from 1207 to 1221 before the later establishment of a Tunisian Hafsid dynasty independent from the Almohads. The Hafsids ruled Tripolitania for nearly 300 years. By the 16th century the Hafsids became increasingly caught up in the power struggle between Spain and the Ottoman Empire.