It contended with the Koutoubia Mosque for prestige and the decoration of its minaret was highly influential in subsequent Moroccan architecture.[77] The mosque was repaired by the Saadi sultan Moulay Abd Allah al-Ghalib following a devastating explosion at a nearby gunpowder reserve in the second half of the 16th century.[78] Notably, the Saadian Tombs were built just outside its qibla (southern) wall, and visitors pass behind the mosque to see them today.