 With its peninsular topography and the construction of a wall 8.3 m thick, the city became impenetrable by land.This strategic location, together with a navy that the Fatimids had inherited from the conquered Aghlabids, made the city of Al-Mahdiyya a strong military base where ʿAbdullāh al-Mahdī consolidated power and planted the seeds of the Fatimid caliphate for two generations.The city included two royal palaces – one for the caliph and one for his son and successor al-Qāʾim – as well as a mosque, many administrative buildings, and an arsenal.