Mahdia is a Tunisian coastal city with 45,977 inhabitants, south of Monastir and southeast of Sousse. Mahdia is a provincial centre north of Sfax. It is important for the associated fish-processing industry, as well as weaving. It is the capital of Mahdia Governorate.
A city already existed at this site during the time of the Phoenicians and Romans; classically it was known as Ruspae and later as Henchir Sbia or just Sbia. In the sixth century it was known as Ruspina, and had a western church diocese. It was destroyed during the Arab conquest of North Africa. Mahdia was founded by the Fatimids under the Caliph Abdallah al-Mahdi in 921 and made the capital city of Ifriqiya, by caliph Abdallah El Fatimi. The role of the capital was taken over by Tunis in the 13th century during the Hafsid Dynasty. Some buildings still exist from the 10th and 11th centuries, such as the Great Mosque and the Casbah, which have helped make the city an important tourist attraction.