Originally sent to Fatimid Egypt in 1163 by his Zengid lord, Nur ad-Din, Saladin climbed the ranks of the Fatimid government by virtue of his military successes against Crusader assaults against its territory and his personal closeness to Fatimid caliph al-Adid. When Saladin's uncle Shirkuh died in 1169, al-Adid appointed Saladin vizier, a rare nomination of a Sunni Muslim to such an important position in the Shia Muslim-led caliphate. During his term as vizier, Saladin began to undermine the Fatimid establishment, and following al-Adid's death in 1171 he assumed control over the government and realigned the country's allegiance with the Sunni Muslim, 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-