The current state of the mosque can be traced back to the Aghlabid period—no element is earlier than the ninth century besides the mihrab—except for some partial restorations and a few later additions made in 1025 during the Zirid period, 1248 and 1293–1294 under the reign of the Hafsids, 1618 at the time of Muradid beys, and in the late nineteenth and early twentieth century. In 1967, major restoration works, executed during five years and conducted under the direction of the National Institute of Archeology and Art, were achieved throughout the monument, and were ended with an official reopening of the mosque during the celebration of the Mawlid of 1972.