Al - Afdal Shahanshah al - Malik al - Afdal ibn Badr al - Jamali Shahanshah ( ) also ( 1066 – December 11 , 1121 ) was a vizier of the Fatimid caliphs of Egypt . Ascent to power . He was born in Acre , the son of Badr al - Jamali , an Armenia n mamluk who became Muslim . Badr was vizier for the Fatimids in Cairo from 1074 until his death in 1094 , when al - Afdal succeeded him . Caliph Ma ' ad al - Mustansir Billah died soon afterwards , and al - Afdal appointed as caliph al - Musta ' li , a child , instead of al - Mustali ' s much older brother Nizar . Nizar revolted and was defeated in 1095 ; his supporters , led by Hassan - i - Sabah , fled east , where Hassan established the Ismaili community , sometimes erroneously called the Hashshashin , or Assassins . At this time Fatimid power in Palestine had been reduced by the arrival of the Seljuk Turks . In 1097 he captured Tyre from the Seljuks , and in 1098 he took Jerusalem , expelling its Ortoqid governor Ilghazi in place of a Fatimid . Al - Afdal restored most of Palestine to Fatimid control , at least temporarily . Conflict with the Crusaders . Al - Afdal misunderstood the Crusaders as Byzantine mercenaries ; this misperception caused al - Afdal to conclude that the crusaders would make for natural allies , as each were enemies of the Seljuk Turks . Fatimid overtures for an alliance with the crusaders were rebuffed , and the crusaders continued southward from Antioch to capture Jerusalem from Fatimid control in 1099 . When it became apparent that the Crusaders would not rest until they had control of the city , al - Afdal marched out from Cairo , but was too late to rescue Jerusalem , which fell on July 15 , 1099 . On August 12 , the Crusaders under Godfrey of Bouillon surprised al - Afdal at the Battle of Ascalon and completely defeated him . Al - Afdal would reassert Fatimid control of Ascalon , as the Crusaders did not attempt to retain it , and utilize it as a staging ground for later attacks on the crusader state s . Al - Afdal marched out every year to attack the nascent Kingdom of Jerusalem , and in 1105 attempted to ally with Damascus against them , but was defeated at the Battle of Ramla . Al - Afdal and his army enjoyed success only so long as no European fleet interfered , but they gradually lost control of their coastal strongholds ; in 1109 Tripoli was lost , despite the fleet and supplies sent by al - Afdal , and the city became the centre of an important Crusader county . In 1110 the governor of Ascalon , Shams al - Khilafa , rebelled against al - Afdal with the intent of handing over the city to Jerusalem ( for a large price ) . Al - Khilafa ' s Berber troops assassinated him and sent his head to al - Afdal . The Crusaders later took Tyre and Acre as well , and remained in Jerusalem until the arrival of Saladin decades later . Legacy and death . Al - Afdal also introduced tax ( " iqta " ) reform in Egypt , which remained in place until Saladin took over Egypt . Al - Afdal was nicknamed " Jalal al - Islam " ( " glory of Islam " ) and " Nasir al - Din " ( " Protector of the Faith " ) . Ibn al - Qalanisi describes him as " a firm believer in the doctrines of Sunnah , upright in conduct , a lover of justice towards both troops and civil population , judicious in counsel and plan , ambitious and resolute , of penetrating knowledge and exquisite tact , of generous nature , accurate in his intuitions , and possessing a sense of justice which preserved him from wrongdoing and led him to shun all tyrannical methods . " He was murdered during Eid ul - Adha in 1121 ; according to Ibn al - Qalanisi , " it was asserted that the Batinis ( Hashshashin ) were responsible for his assassination , but this statement is not true . On the contrary it is an empty pretence and an insubstantial calumny . " The real cause was the growing boldness of the caliph al - Amir Bi - Ahkamillah , who had succeeded al - Musta ' li in 1101 , and his resentment of al - Afdal ' s control . Ibn al - Qalanisi states that " all eyes wept and all hearts sorrowed for him ; time did not produce his like after him , and after his loss the government fell into disrepute . " He was succeeded as vizier by Al - Ma ' mun .