The Arab Conquest
The Arabs, who conquered Egypt for the Muslim empire in 642, reached Tunisia in 647, but on the payment of tribute withdrew. However, about 670 the Arabs founded Kairouan as a military base and undertook the conquest of all North Africa. Carthage fell to them in 698 and was replaced as the major northern seaport by Tunis. The Tunisian region was made the province of Ifriqiya (Arabic for “Africa”) in the Muslim empire, with Kairouan, which had become the sacred city of Islam in North Africa, as capital.
Far removed from the center of Muslim power, Tunisia came under the rule of various factions. A local dynasty, the Aghlabids, came to power in 800. The Fatimid dynasty overthrew them in 909 and made Mahdia their capital. In 969 the Fatimids completed the conquest of Egypt and founded Cairo as their capital. The governor whom they left in Tunisia founded a new autonomous dynasty, the Zirids. In 1049 the Zirids broke away from Shiite Islam, the religion of the Fatimids, and recognized the authority of the caliph at Baghdad. The Fatimids then encouraged large numbers of Bedouins to migrate from Egypt to Tunisia. The Bedouins pillaged the country, causing such devastation that Tunisia was impoverished for generations afterward.
In the next century Normans from Sicily seized several coastal cities of Tunisia, but were expelled by the Almohads, who came from Morocco. In the 13th century an Almo-had governor of Tunisia proclaimed his independence and founded the Hafsid dynasty, which ruled for more than 300 years. The Eighth Christian Crusade (1270–72) was launched against Tunisia, but the death of (Saint) Louis IX of France there ended the campaign.

