Emirate of Tlemcen

The Ifranid Emirate of Tlemcen or Ifranid Kingdom of Tlemcen,  was a Kharijite state, founded by Berbers of the Banu Ifran in the eighth century, with its capital at Tlemcen in modern Algeria.

Background
The Banu Ifran were a Zenata Berber tribe who originated from modern-day Yafran in Libya. After the Muslim conquest of the Maghreb, there were a number of Berber revolts against the Umayyad caliphate. These mid-eighth century revolts were associated with Kharijite teachings, which won over a good part of the Maghreb with their puritanism and egalitarian message. As a result of one of these, the Rustamid dynasty founded a kingdom at Tahert.

Foundation of the Emirate
Around the same time, a revolt of the Banu Ifran broke out. The rebels proclaimed their leader Abu Qurra to be the Caliph, and he established a Sufri state in Tlemcen. Although the founding of this city is sometimes attributed to the Ifranids, the site had already been occupied by the Roman city of Pomaria. Little is known of the internal affairs of the new state, but it was of considerable military significance.

Expansion
Between 767 and 776 Abu Qurra began to lead expeditions against the Abbasids and became their most important enemies. Abu Qurra hunted down the Abbasid governor after reaching Tobna, Omar ibn Hafç-Hazarmard, who had hidden in Kairouan which Abu Qurra then besieged and subdued after defeating the Abbasid army. Back in Tlemcen, he allied himself with the Maghrawa and had to confront the expansionist aims of the Idrisids. The Abbasids sent a strong army under the new governor, Yazid ibn Hatim al-Muhallabi, who defeated the Kharijites in Ifriqiya, but the rest of the Maghreb escaped his authority.

Legacy
The kingdom did not last long: in accordance with the strict rules of Sufrites, Abu Qurra would not allow his descendants to found a dynasty. He welcomed Idris I, recognizing his kingdom and breaking with the Rustamids. Idris I negotiated the surrender of Tlemcen with the Maghrawa. One of his descendants, Muhammed Sulayman, established the Sulaymanid kingdom in the region, a state that dominated the cities and lasted until the time of the Fatimids in 931. Tlemcen became a distinguished city, growing in connection with the Sunni Arab culture of Al-Andalus; in the countryside however, the Ifranids retained their heterodox faith. In 955 their leader Yala Ibn Mohamed revolted against the Fatimids.