In 756 AD, 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. In 757 AD, the Warfajuma forces, led by
Asim ibn Jamil al-Warfajumi, entered the city of Kairouan without resistance and proceeded to carry out massacres. Asim bin Jamil subsequently departed from Kairouan, appointing
Abd al-Malik ibn Abi Ja’d al-Nafzawi as its governor. He then advanced with his forces toward Habib in
Gabès, where he defeated him and compelled him to withdraw from Gabès to the
Aurès Mountains. There,
Habib reorganized his forces and launched an attempt to recapture Kairouan; however, he was defeated and killed by the
Berbers in a battle on the outskirts of the city in May/June 757. Thus ended the rule of the
Fihri family, descendants of
Uqba ibn Nafi and Kairouan fell to the
Sufrite, who continued to plunder the city. They reportedly tied their animals within
the Great Mosque, killed the
Arab Qurayshi and massacre inhabitants. == Aftermath ==