Table o contents
A ceety awready existit at this site durin the time o the Phoenicians an Romans, but wis destroyed durin the Arab conquest o North Africae. Mahdia wis foondit bi the Fatimids unner the Caliph Abdallah al-Mahdi in 921 an made the caipital ceety o Ifriqiya, bi caliph Abdallah El Fatimi. It wis chosen the caipital acause o its proximity tae the sea, an the promontory on which an important military settlement haed been syne the time o the Phoenicians. In 1087 the toun wis attacked bi raidin ships frae Genoa an Pisa who burned the Muslim fleet in the harbor. This played a critical role in winnin control o the Wastren Mediterranean an allouin the First Crusade tae be supplied bi sea. The Zirid dynasty haed its residence here in the 11t century, but wis brought tae an end bi the Norman conquest o the ceety in 1148. In 1160 the ceety comes unner Almohad rule.
The role o the caipital wis taken ower bi Tunis in the 13t century durin the Hafsid Dynasty. Some biggins still exist frae the 10t an 11t centuries, such as the Great Mosque an the Casbah, which hae helped make the ceety an important tourist attraction.