Kairouan has long been considered as the spiritual capital city of Tunisia. It was founded in 670 AD by Uqba Ibn Nafii, the commander of the Muslim forces of the Umayyad dynasty in Ifriqiya (North Africa). He made of Kairouan a military base and an important settlement from which additional conquests in North Africa and southern Spain were planned and achieved. At the time of the foundation of Kairouan, the other regions of North Africa were under the control of the Byzantines. Ifriqiya became then an Umayyad province. Subsequently, it passed under the Abbasid rule before earning its independence under the Aghlabid dynasty. After 800 AD, the Aghlabids made of Kairouan a cultural and religious capital of great splendour and magnificence and one of the greatest centers of Islamic civilization.
The importance of the city declined from the year 909 on, when the Fatimids established their power in Ifriqiya. These Shiite caliphs decided to found a new capital on the coast, Mahdiya. But this decline did not last long, because in the year 949, the Fatimids established their capital in Sabra al-Mansuriya, near Kairouan.
Kairouan’s brilliance was preserved until the middle of the 11th century when the Hilalian tribes plundered the city. Then it was practically abandoned and lost its political and economic importance. Since that time, the city knew moments of relative importance, as in the Hafsid period, between the 13th and 16th centuries in which numerous and rich monuments were built.
In 1988, Kairouan was declared as Heritage of Humanity by UNESCO.