The Aghlabids (الأغالبة) were an Arab dynasty from the tribe of Banu Tamim, who ruled Ifriqiya and parts of Southern Italy, Sicily, and possibly Sardinia, nominally on behalf of the Abbasid Caliph, for about a century, until they were overthrown by the new power of the Fatimids.
In 800, the Abbasid Caliph Harun al-Rashid appointed Ibrahim I ibn al-Aghlab, son of a Khurasanian Arab commander from the Banu Tamim tribe, as hereditary Emir of Ifriqiya, in response to the anarchy that had reigned in that province following the fall of the Muhallabids. At that time there were perhaps 100,000 Arabs living in Ifriqiya, although the Berbers (Imazighen) still constituted the great majority.
Ibrahim was to control an area that encompassed what is now eastern Algeria, Tunisia and Tripolitania. Although independent in all but name, his dynasty never ceased to recognise Abbasid overlordship. The Aghlabids paid an annual tribute to the Abbasid Caliph and their suzerainty was referenced in the khutba at Friday prayers.
After the pacification of the country Ibrahim ibn al-Aghlab established a residence at a new capital, al-Abbasiyya, founded outside Kairouan in 800 and built between 801 and 810. This was done partly to distance himself from the opposition of the Malikite jurists and theologians, who condemned what they saw as the luxurious life of the Aghlabids (not to mention the fact that the Aghlabids were mu'tazilites in theology, and Hanafis in fiqh-jurisprudence), and disliked the unequal treatment of the Muslim Berbers. Additionally, border defenses such as ribats were set up, including in coastal cities like Sousse (Susa) and Monastir. The Aghlabids also built up the irrigation of the area and enhanced the public buildings and mosques of Ifriqiya. Slaves were obtained through the trans-Saharan trade, through Mediterranean commerce, and from raids on other lands like Sicily and Italy.
The Aghlabid army was composed of two main elements. The first was the jund, or Arab troops descended from the Arab tribesmen who had participated in the early Muslim conquests of North Africa.