He was originally sent to Fatimid Egypt in 1164 alongside his uncle Shirkuh, a general of the Zengid army, on the orders of their lord Nur ad-Din to help restore Shawar as vizier of the teenage Fatimid caliph al-Adid. A power struggle ensued between Shirkuh and Shawar after the latter was reinstated. Saladin, meanwhile, climbed the ranks of the Fatimid government by virtue of his military successes against Crusader assaults against its territory and his personal closeness to al-Adid. After Shawar was assassinated and Shirkuh died in 1169, al-Adid appointed Saladin vizier, a rare nomination of a Sunni Muslim to such an important position in the Shia caliphate. During his tenure as vizier, Saladin began to undermine the Fatimid establishment and, following al-Adid's death in 1171, he abolished the Fatimid Caliphate and realigned the country's allegiance with the Sunni, Baghdad-based Abbasid caliphate.
In the following years, he led forays against the Crusaders in Palestine, commissioned the successful conquest of Yemen, and staved off pro-Fatimid rebellions in Upper Egypt. Not long after Nur ad-Din's death in 1174, Saladin launched his conquest of Syria, peacefully entering Damascus at the request of its governor. By mid-1175, Saladin had conquered Hama and Homs, inviting the animosity of other Zengid lords, the official rulers of Syria's various regions. Soon after, he defeated the Zengid army at the Battle of the Horns of Hama of 1175 and was thereafter proclaimed the "Sultan of Egypt and Syria" by the Abbasid caliph al-Mustadi. Saladin made further conquests in northern Syria and the Jazira, escaping two attempts on his life by the Order of Assassins, before returning to Egypt in 1177 to address issues there. By 1182, Saladin had completed the conquest of Muslim Syria after capturing Aleppo, but ultimately failed to take over the Zengid stronghold of Mosul.
Under Saladin's command, the Ayyubid army defeated the Crusaders at the decisive Battle of Hattin in 1187, and thereafter wrested control of Palestine—including the city of Jerusalem—from the Crusaders, who had conquered the area 88 years earlier. Although the Crusader Kingdom of Jerusalem continued to exist until the late 13th century, its defeat at Hattin marked a turning point in its conflict with the Muslim powers of the region. Saladin died in Damascus in 1193, having given away much of his personal wealth to his subjects. He is buried in a mausoleum adjacent to the Umayyad Mosque. Saladin has become a prominent figure in Muslim, Arab, Turkish and Kurdish culture, and has been described as the most famous Kurd in history.