The Aghlabids: Shield of the Abbasid Dynasty
‘Caliph Harun Al-Rashid gave Ifriqiya to Ibrahim Ibn al-Aghlab as a hereditary principality to rule.’
Due to the vast size of the Abbasid Empire and the presence of several rival Islamic powers on the doorstep in 184 / 800 the Abbasids established the Aghlabid principality in North Africa to deal with the Umayyads in al-Andalus and the Idrisids in Morocco. The Abbasid caliph Harun al-Rashid (r. 170–93 / 786–809) gave Ifriqiya (Tunisia) to Ibrahim Ibn al-Aghlab as a hereditary principality to rule. The Aghlabids became the vassals of the Abbasids in Ifriqiya between the years 184 / 800 and 296 / 909. They rebuilt several cities and constructed many military fortifications along the Ifriqiyan coast to rebuke the Byzantines who had conquered Sicily several centuries before. They also organised civic affairs and developed communication routes between North Africa and the Middle East.
Great Mosque of Kairouan

Hegira 221 / AD 836
Umayyad, Abbasid
Kairouan, Tunisia
Known also as the Mosque of 'Uqba Ibn Nafi' who was the founder of the Abbasid city of Kairouan, and the Great Mosque.