History
Kairouan was founded in about the year 670 when the Arab general Uqba ibn Nafi selected a site in the middle of a dense forest, then infested with wild beasts and reptiles, as the location of a military post. It was to keep in check the Berber hordes and was located far from the sea where it was safe from attack. A city soon developed, with luxuriant gardens and olive groves. Ibn Nafi was killed in battle by the Berbers about fifteen years after the military post was established.
The city was soon recaptured and remained for four centuries a major holy city, the "Mecca of North Africa". In the tenth century, the city was embellished by the Aghlabites who ruled Ifriqiya from there between 800 and 909. It was the capital in the eleventh century, and was famous for its wealth and prosperity.
About the middle of the eleventh century, the Ismaili Shiite Fatimites of Egypt instigated the Egyptian Bedouins to invade this part of Africa. These invaders so utterly destroyed the city in 1057 that it never regained its former importance. Then Mahdia became the capital under the Fatimites. Under the Ottomans, who called it Kairuan in Turkish (as in modern German), and included mention of the city in the full style of the Great Sultan (alongside broader Barbary and the new vilayet), Tunis became the capital (as seat of the Dey, next the soon ever more autonomous (Basha) Bey), and remains so in modern Tunisia. In 1881, Kairouan was taken by the French, after which non-Muslims were allowed access to the city.
Religion
There are very many mosques in the city, among which the great mosque. For a long time, non-muslims were not allowed to enter the city, in more recent times this is allowed. Pilgrimages are made to this holy city. An article titled “Towards A Strategic Geopolitic Vision of Afro-Arab Relations” [2] by Professor Kwesi Prah [3] states “By 670, the Arabs had taken Tunisia, and by 675, they had completed construction of Kairouan, the city that would become the premier Arab base in North Africa. Kairouan was later to become the third holiest city in Islam in the medieval period, after Mecca and Medina, because of its importance as the centre of the Islamic faith in the Maghrib". [4]
Judaism, no longer prevalent in the city, has an illustrious history in Kairouan, particularly in the early Middle Ages. Rabbeinu Hananel was from Kairouan and many other important and famous rabbis, including the RIF, (Rabbi Isaac Alfasi) studied there with him.