Maghreb
Bordered by the Mediterranean to the north, crossed by the Atlas mountain ranges, and reaching southward to the northern edge of the Sahara, the Maghreb linked the western Islamic lands of Ifriqiya, the central Berber highlands, and Morocco. From 800, Aghlabid emirs governed Ifriqiya from royal palace cities outside Kairouan while funding enlargements of Kairouan’s Great Mosque; the Fatimids took Ifriqiya from Kabylia in 909 and several years later began building the coastal stronghold of Mahdia.
In the eleventh and twelfth centuries, Berber empires reshaped the western Islamic world. The Almoravids governed the western Maghreb and much of al-Andalus from Marrakech, and the Almohads later marched eastward to conquer Tunis; as Almohad power receded, the Hafsids established rule in Tunis while the Marinids governed Morocco from Fez.