“Today’s Mahdiya may seem small, but during its heyday Mahdiya was the Fatimid capital of North Africa and the successful home base that led to the conquest of Cairo, which then ultimately led to the city’s demise as Cairo took over as the capital of the Fatimid empire” – excerpt from Tunisia.com
Please also read related article: Great Moments in Ismaili History: The Establishment of the Fatimid Caliphate
Al-Mahdiya was the first capital of the Fatimids, and was built in 913 by the 11th Ismaili Imam/first Fatimid Caliph, al-Mahdi. The city functioned as a port from which the Fatimids launched their campaign to conquer Egypt, which they did in 969. Thereafter, the capital shifted to Cairo.
Architecturally the most significant building in the town is the Great Mosque built in 916. This is the earliest surviving example of a Fatimid mosque. The design of the mosque differs considerably from earlier North African mosques as it had no minarets and only one monumental entrance giving it the appearance of a fortress rather than a mosque. It is believed that the entrance was reserved for the Fatimid Imam, his family and court. The other features of the mosque included a courtyard with single arcades on all four sides, and a sanctuary with a T-shaped arrangement of nave and transepts.