In later centuries the mosque has been abandoned and re-used for a variety of purposes. During Napoleon's occupation of Egypt (1798-1801) it was used as a military fort and headquarters, called Fort Sulkowski. It was then used as a barracks for a Senegalese community in the time of Muhammad Ali (first half of the 19th century). Later it was used as a soap factory and a bakery. During the British occupation it was used as an army warehouse and then an abattoir. Under King Fuad it was converted into a public garden. The mosque has remained abandoned and disused in recent years, but a major government-led restoration project on the mosque started in 2007.