 The mosque was completed in 478 H/1085 AD under the patronage of then Caliph and Imam Ma'ad al-Mustansir Billah.It was built on an end of the Mokattam Hills, ensuring a view of the Cairo city.This Mosque/mashhad was also known as a victory monument commemorating vizier Badr's restoration of order for the Imam Mustansir.