Its construction was sponsored by Badr al-Jamali, the vizier of al-Mustansir, who was Amir al-Juyush (Arabic: امير الجيوش, lit.
[1] The building's construction is dated by an Arabic foundation inscription to 1085, during the Fatimid period and the reign of al-Mustansir Billah.
[4][1] The most plausible theory is that the monument commemorates the victories of Badr al-Jamali, the powerful Fatimid vizier whose title, Amir al-Juyush ("Commander of the Armies"), is invoked in the foundation inscription.
[2] The structure's isolated setting on the Muqattam hills above Cairo is also unusual and has even led to one scholarly theory suggesting it was actually a watchtower disguised as a mosque.
On one side of the courtyard is the prayer hall or sanctuary, while opposite this, standing on the central axis of the building, is a minaret.
[2] Along the top of the minaret's first rectangular portion is a cornice of muqarnas (stalactite-like sculpting) which is the earliest surviving example of this type of decoration in Egypt.
The inscription further continues:[3] The construction of this blessed martyrium [mashhad] was ordered by the servant of our lord and master Imam al-Mustansir billah, Commander of the Believers, may the blessings of God be upon him and upon his forefathers, the pure imams, and upon his most magnanimous descendants and peace until the Day of Judgment - the most illustrious lord commander of the armies, sword of Islam, helper of the imam, surety of the judges of the Muslims and guide to the propagandists of the believers - may God strengthen through him the religion, and give pleasure to the Commander of the Believers by the length of his stay, and make his power lasting and make his word prevail and deceive his enemies and those envious of him as he seeks the good pleasure of God, in the month of Muharram 478 [1085 CE].
Every man of them shall have the sin that he has earned charged to him; and whosoever of them took upon himself the greater part of it, him there awaits a mighty chastisement.
At the summit of the dome is a carved medallion with a six-pointed star formed by the words Muhammad and Ali each repeated three times.