The first Fatimid imam, Abdullah al-Mahdi Billah, founded Mahdia in 909.
Between 1961 and 1965 the mosque was completely renovated by the French architect Alexandre Lézine, while respecting the overall layout and structure of the tenth century building.