ibn Jamil al-Warfajumi to take power in Kairouan and depose his nephew Habib. To rally support to their arms, the rebels declared for the Abbasid caliph Al-Mansur. In 756-57, heeding the danger, Habib ibn Abd al-Rahman set out south against the Warfajuma, leaving the qadi Abu Quraib in charge of Kairouan. But the Ifriqiyan army was roundly defeated by the Berber rebels. Habib proceeded to take shelter in Gabès and appealed to Abu Quraib to dispatch reinforcements from Kairouan. But these were intercepted by the Berber force and, hearing the rebels had declared for the Abbasids, decided to switch over to them. In early 757, the Warfajjuma under Asim ibn Jamil, marching under the black banner of the Abbasids, entered Kairouan unopposed. The Fihrid Abd al-Wareth disappears from the chronicles around this time. Habib, who was forced out of Gabès, and regathered his forces in the Aures hills and made a dash to recover Kairouan but was defeated and killed by the Berbers in the outskirts of the city in May–June, 757. What happened in the aftermath has been much debated. It is alleged by Arab chroniclers that upon seizing the city, the Warfajuma Berbers, possessed by a fanatical (Sufrite) Kharijite fervor, set about plundering the city of Kairouan and undertaking great massacres of the civil population (the radical Sufrite brand of Kharijitism sported by the Warfajuma leaders regarded all non-Kharijites as outright apostates deserving death). In the meantime, profiting from the Fihrid family quarrel, the Ibadites that Abd al-Rahman ibn Habib had driven into the Tripolitan hills of Jebel Nafusa in 752 mounted a comeback. Rallied by their new imam Abu al-Khattab al-Ma'afiri, the Ibadites seized Tripoli sometime in 757. Although also a Kharijite sect, the Ibadites were considerably less fanatical than the Sufrites and were horrified to hear of the massacres in Kairouan. In 758, the Ibadites set out to defeat the Warfajuma and capture Kairouan, putting an end to the Sufrite terror and establishing an (Ibadite) Kharijite imamate over Ifriqiya. See also History of early Islamic Tunisia History of medieval Tunisia References Sources Ibn Khaldun, Histoire des Berbères et des dynasties musulmanes de l'Afrique, 1852 transl. Algiers. Julien, Charles-André, Histoire de l'Afrique du Nord, des origines à 1830, édition originale 1931, réédition Payot, Paris, 1961 Mercier, E. (1888) Histoire de l'Afrqiue septentrionale, V. 1, Paris: Leroux. Repr. Elibron Classics, 2005. Emirs of Ifriqiya 8th-century Arabs 757 deaths