Al-Afdal Shahanshah, born Abu al-Qasim Shahanshah bin Badr al-Jamali, was a vizier of the Fatimid caliphs of Egypt. According to a later biographical encyclopedia, he was surnamed al-Malik al-Afdal, but this is not supported by contemporary sources.
Foundational inscription from Sidon, in the name of al-Afdal
Abū'l-Najm Badr ibn ʿAbdallāh al-Jamālī al-Mustanṣirī, better known as Badr al-Jamali, was a vizier and prominent statesman for the Fatimid Caliphate under Caliph al-Mustansir. His appointment to the vizierate in 1073 restored the fortunes of the Fatimid state, which had faced collapse in the previous decades, but also began a period where the vizierate was dominated by military strongmen who held power through their military strength, rather than through the Caliph's appointment. An Armenian Badr al-Jamali initiated a wave of Armenian migration into Egypt, and was the first of a series of viziers of Armenian origin, who played a major role in the fortunes of the Fatimid Caliphate over the subsequent century.
Juyushi Mosque in Cairo, founded by Badr