The Rustamid Imamate. The Rustamid imamate (777-909) was the first important Islamic state of the central Maghreb, ruled from the city of Tahert in what is now Algeria. It was founded by Abd al-Rahman ibn Rustam, a Persian-born scholar who had studied under the early leaders of the Ibadi movement in Basra. After Ibadi uprisings against the Abbasids failed in the east, Ibn Rustam fled west, and in 777 the Ibadi communities of the region elected him imam, establishing a state independent of the caliphate.
The imamate was organized around Ibadi religious principles. The imam was chosen for piety and learning rather than pure hereditary right, advised by councils of religious scholars, and expected to live simply. Tahert grew into a handsome and prosperous city surrounded by gardens and fortified walls, home to Berber tribes of the region, Arab settlers, and merchants and scholars from across the Islamic world, including Christians and Jews who lived under its protection. Ibadi missionaries and traders spread the doctrine from Tahert deep into the Sahara and the Sudan.
Tahert owed much of its wealth to trade. The city sat on the routes linking the Mediterranean coast with the oases of the northern Sahara, and its merchants dealt in goods moving between Ifriqiya, al-Andalus, and the regions beyond the desert. Contemporary writers described Tahert as one of the most flourishing towns of the Maghreb, and its imams maintained diplomatic relations with their nominal Abbasid overlords while in practice governing themselves for over a century.
The end came with the rise of the Fatimids. The Fatimid movement conquered Ifriqiya in 909 and then swept west; Tahert was taken, the last Rustamid imams were killed or fled, and surviving Ibadi communities retreated to desert strongholds such as the Mzab valley, where they remain today. The Rustamid imamate is remembered as a pioneering experiment in elected religious government, and as the state that carried Islamic urban civilization into the central Maghreb a generation before the rise of Fez.