 This important factor, accompanied by the dynasty's eventual collapse into decadence, opened the way for Tahert's demise under the assault of the Fatimids.The Muslim 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.It was chosen as the capital because of its proximity to the sea, and the promontory on which an important military settlement had been since the time of the Phoenicians.