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 15 July 1099. On 12 August 1099, the Crusaders under
Godfrey of Bouillon surprised al-Afdal at the
Battle of Ascalon and completely defeated him. Al-Afdal would later 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 states. When al-Musta'li died in December 1101, al-Afdal raised the five-year-old
al-Amir bi-Ahkam Allah to the throne as imam and caliph. To further strengthen the familial ties with the young caliph, he married him to his own daughter. As the vizier, father-in-law, and uncle of the young ruler, al-Afdal placed the caliph before him on his own horse during al-Amir's inaugural procession. A decree, dictated by al-Afdal, renewed his appointment as vizier with plenipotentiary powers and ensured his ascendancy over the child-caliph. 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
Third 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 the Crusader state of the
County of Tripoli. 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 was assassinated by his Berber troops, sending his head to al-Afdal. 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." == Final years and assassination ==