 After failing to capture the Umayyad provincial capital of Kairouan, the Berber rebel armies dissolved, and the western Maghreb fragmented into a series of small Berber statelets, ruled by tribal chieftains and Kharijite imams.The Berber revolt was probably the largest military setback in the reign of Caliph Hisham.From it, emerged some of the first Muslim states outside the Caliphate.