Saladin arrived in Egypt in 1163 and ruled it from 1171 until his death in 1193. Egypt was in a state of decay prior to Saladin's rise to power with the political and social situation in shambles. Saladin first arrived in Egypt alongside his uncle Shirkuh on a campaign launched by Nur al-Din. He would rise to prominence under Shirkuh eventually succeeding him as vizier of Egypt. When the Fatimid Caliphate fell in 1171, Saladin was the only remaining authority in Egypt, he would use his increased power and independence to expand his realm and influence.
The Fatimid Caliphate that had ruled in Egypt since 969 was on the verge of total disintegration in the period before Saladin's arrival. The challenges that faced the state were extensive and touched on every aspect of life in Egypt. The condition of Fatimid Egypt can be best segmented into three areas: political, social, and economic.
Power in the Fatimid Caliphate ultimately rested with the caliph. Over the years, however, true power had shifted into the office of the vizier. Initially, the vizier was intended to be the chief administrator of the state, serving at the will and pleasure of the caliph. This changed with the rise of Badr al-Jamali (1074–1094) to the position. Badr and his successors, who were mostly drawn from the military, combined the vizierate with the post of "commander of the armies" and held full powers in the caliph's stead. These "viziers of the sword" were at the same time chief ministers in charge of all civil administration, heads of the army, responsible for all judicial matters as chief qāḍī, and even for all religious matters of the Isma'ili community as head missionary (dāʿī al-duʿāt). As the viziers' power grew to eclipse the caliphs', they even assumed the title of "king" (al-malik) followed by an epithet.
Any remaining power the caliphs may have had was shattered when the last adult caliph, al-Hafiz, died in 1149. This death initiated yet another period of instability and intrigue, culminating with the killing of many males in the Fatimid royal family in 1153. These killings sparked a revolt by the Armenian governor of Middle Egypt, Tala'i ibn Ruzzik, who was aided by Sitt al-Qusur, sister of the young caliph al-Fa'iz. Ibn Ruzzik quickly consolidated his rule over Egypt (preventing any intervention Nur al-Din may have been planning) and ruled effectively. Under Ibn Ruzzik, Egypt regained some measure of international influence, successfully defending itself from naval molestation, raiding opposition shipping in the Eastern Mediterranean, and engaging in negotiations with Nur al-Din concerning a unified jihad against the Crusader States. The Crusaders in the Kingdom of Jerusalem were not unaware of the delicate nature of their position and sought to establish a functional relationship with Ibn Ruzzik, culminating with a truce between the two states with Egypt paying large annual sums to Jerusalem as one of the conditions. In 1161, Ibn Ruzzik was assassinated and with him died stability in Egypt. Ibn Ruzzik's son succeeded him but was quickly overthrown by the Arab governor of upper Egypt, Shawar, in 1163. In the same year Shawar himself was almost immediately overthrown by a courtier named Dirgham. Shawar fled Egypt and sought aid from Nur al-Din in Syria. The internal chaos of 1163 spilled over onto the international arena when the new king of Jerusalem, Amalric I, undertook a punitive campaign in Egypt in response to the failure of the Egyptian to pay their annual tribute. Amalric's campaign was stopped not by the Fatimid military, but rather the flooding Nile that crippled his army while they laid siege to the town of Bilbays in northern Egypt.
The official doctrine of the Fatimid state was Isma'ilism, a branch of Shi'a Islam espoused by the Fatimids. According to Isma'ili beliefs, the caliph was also the imam, the divinely chosen and guided heir of the Prophet Muhammad, in direct and unbroken succession via Ali ibn Abi Talib. The Fatimids' claim of descent from Ali was challenged already during the 10th century, both by the Sunni Abbasids but also by many Shi'ites, who rejected their legitimacy and claimed that they were impostors. Most Egyptians rejected Ismailism and practised Sunni Islam. Tensions were further exacerbated as the Caliphs steadily lost power, including the power to support their state religion. Into this growing void stepped Sunni Islam, which thrived in Egypt's north especially around the city of Alexandria. Already in, the military strongman Nasir al-Dawla ibn Hamdan had tried to depose the dynasty and restore Sunni rule over Egypt. The prestige of the caliphate diminished further following a series of deeply divisive schisms within the Isma'ili faith itself, over the succession to the imamate/caliphate: the Nizari schism of 1094 and the Hafizi schism of 1130/32.
In addition to this mounting religious pressure the ever unstable nature of Egyptian political life forced elites in every field (administrative, poetic, legal, etc.) into tight knit social circles often susceptible to purges when rival factions seized power. This resulted in the deaths of many of Egypt's most talented people, contributing to the free fall of the Fatimid state.
Perhaps the only part of Egypt before Saladin that can be referred to as successful was its economy. Since ancient times the fertile banks of the Nile had made Egypt the bread basket of the Eastern Mediterranean. The tombs of the Pharaohs served as man made gold mines to the Fatimids, who actively stripped the wealth of these ancient tombs to support their projects. The final lynch pin in Egypt's successful economy was the growth of trade. Trade routes extended as far as India with goods from the East funnelling through upper Egypt on their way to Europe and the Middle East, contributing to the extensive growth of trade cities like Damietta and Alexandria. For once the weakness of the Fatimid state served as an advantage as people of all religious backgrounds capitalized on all aspects of the thriving trade and succeeded in creating a surprisingly successful financial system. This strong economy and financial system provided the Egyptian viziers like Ibn Ruzzik with the ability to wield amazing funds in both internal and international politics.
Nur al-Din had long sought to intervene in Egypt especially after missing his opportunity when Tala ibn Ruzzik successfully brought the country under control, blocking his ambitions for nearly a decade. Thus, Nur al-Din closely watched the events of 1163 with his reliable general Shirkuh waiting for an appropriate opportunity to bring the country under his control. Before the campaigns it would be hard to find a figure more obscure than Saladin, but by their end he would emerge as one of the most prominent figures in the Medieval Middle East.
In Syria, Shawar easily convinced Nur al-Din to support his cause in Egypt. Nur al-Din was motivated partially by his long standing desire to gain control over Egypt and partially by a desire to block further military adventures by Amalric. Nur al-din sent the head of his army Shirkuh (who in turn took his nephew, Saladin, with him) to accompany Shawar back to Egypt and return him to power. The force set out in May 1163 and quickly entered Cairo where they deposed Dirgham. Once Dirgham had been overthrown, however, it quickly became clear that Shawar was not going to uphold his agreement, neither paying tribute to Nur al-Din nor giving Shirkuh's troops the fiefs he had promised. Shawar then entered into negotiations with Amalric in an attempt to garner support against his former benefactor. He ultimately enticed Amalric into an alliance against Nur al-Din by making several concessions including the release of Christian prisoners and submitting to the Kingdom of Jerusalem. Together Amalric and Shawar marched on the city Bilbays, which Shirkuh was using as his base. Neither of the allies wanted to storm the city so they chose to put it under siege (the native Egyptians understood the flood cycles of the Nile and thus knew they would not suffer the same fate as Amalric's previous siege of the city). Nur al-Din took advantage of the absence of Amalric and Jerusalem's army to attack the Crusader States, winning a pitched battle and retaking the city of Harim. Nur al-Din continued his advance and took the city of Baniyas, forcing Amalric to return from Egypt. A peace deal was brokered in November 1163 which required both Amalric and Shirkuh to withdraw from Egypt in exchange for large payments from Shawar. Shawar emerged as the ultimate victor having both gained personal control of Egypt and having avoided submission to either Nur al-Din or Amalric.
The ambitious Shirkuh was discontented with the result of the 1163 campaign and began preparing for a new invasion of Egypt. Shawar was aware of Shirkuh's intentions and entered into negotiation with Amalric to renew their alliance in the event of Shirkuh's invasion. In late 1166 and early 1167, Shirkuh, again with Saladin, attacked Egypt with Nur al-Din's support. Amalric and Shawar quickly mobilized against Shirkuh's coming force. Shirkuh managed to avoid Amalric's army in the open and travel south into Egypt and use the west bank of the Nile to stave off an attack from the combined forces of Amalric and Shawar. Finally in March 1167 the allies forced a battle which Shirkuh won, despite heavy losses to both sides. Shirkuh then proceeded to Alexandria where the largely Sunni population opened their gates to him and offered support. Amalric and Shawar quickly regrouped, however, and closed on Alexandria. Not willing to be trapped with his main army in Alexandria, Shirkuh left the city, leaving Saladin and a small force to defend it. The allies quickly subjected the city to a vicious siege. In his first major military position, Saladin managed to organize a continued defense of the city and maintain the support of the population, despite great suffering brought on by the long siege. Shirkuh remained largely inactive in the countryside, failing to attack either the besieging army or the garrisoned city of Cairo, which held the Fatimid Caliph. Ultimately a peace treaty was negotiated between Shirkuh and the allies with the agreement that Amalric and Shirkuh would withdraw their forces in exchange for payments and amnesty would be granted to the people of Alexandria (Shawar was only held from retribution on the city after it was made part of the peace agreement and Amalric promised protection to the city). Saladin stayed in the Crusader camp during these negotiations in which he sought to assure the terms protecting Alexandria.
Facing internal pressures stemming from his unpopular alliance with Amalric, Shawar tried to negotiate with Nur al-Din to keep Shirkuh from attacking Egypt for a third time. It was Shawar who found himself betrayed, however, when Amalric attacked Egypt in 1168. Amalric quickly captured the city of Bilbays in early November and massacred the population that had frustrated him twice in 1163. He then quickly marched on Fustat, the official capital of Egypt, before Shawar could gather his forces. Shawar responded by burning the city before Amalric could take it and use it as a base against Cairo (the Caliph's city and de facto capital of Egypt). Unimpressed by Shawar's actions, Amalric besieged Cairo and attempted to storm the city. With the enemy at the gates of his city, the Fatimid Caliph, al-Adid, requested aid from Nur al-Din. Nur al-Din quickly ordered Shirkuh to return to Egypt. Shirkuh again recruited Saladin who apparently took convincing following the hard times he had endured at Alexandria. Shirkuh left for Egypt in December 1168. Hearing of Shirkuh's arrival in Egypt in January 1169, Amalric quickly negotiated a truce with Shawar (including the usual payments by the Egyptians in exchange for withdrawal) and returned to Jerusalem. With the support of al-Adid, Shirkuh entered Cairo unopposed. Saladin then personally arrested Shawar and brought him to al-Adid, who ordered Shawar's execution. Shirkuh was appointed the new vizier and gave Saladin a high administrative position. Shirkuh died shortly afterwards, in March 1169, after an exceptionally large and rich meal. Saladin was then selected from Shirkuh's emirs to become the vizier (though it is unclear whether or not the emirs selected him or the Egyptians chose him in an attempt to create conflict between the Kurdish and Turkish emirs).
The ascension to the vizierate was clearly a defining moment in his life. He married for the first time. The Fatimid State he inherited was every bit as unstable as the one Shawar had seized, but Saladin faced the additional challenge of being a foreign occupier. This challenge was increased because Saladin's overlord, Nur al-Din, knew little of his deceased emir's nephew, other than that he was from the famously ambitious Ayyubid family. Thus Saladin's time as vizier can best be judged as trying to repair the political and social situation is Egypt while under constant scrutiny from Nur al-Din, who believed that the addition of Egypt's resources to his Syrian empire as one of the final steps towards completing his jihad against the Crusader States.
Saladin almost immediately faced challenges from the established pro-Fatimid military and civilian elites, who feared that the presence of a foreign Sunni vizier would result in the destruction of their dynasty. A conspiracy against Saladin by these elites formed in 1169 centered around the black eunuch who served as majordomo of the Caliph's palace. Saladin uncovered this plot and had the eunuch executed while outside of the city inspecting his properties. This execution triggered an uprising by the black units of the Fatimid military who were both numerous and extremely loyal to the Caliphate. Saladin quickly and effectively put down this revolt and began restructuring the Fatimid military around the Syrian units who had remained with him in Egypt, both increasing the effectiveness of the military and granting him greater personal control over it. This revolt was not the only challenge of 1169 as Amalric returned and, with support of the Byzantine navy, attempted to take Damietta. Disunity between the attackers forced them to settle for terms and withdraw. But having established a relatively secure position by 1170, Saladin increased his power within Egypt by importing his family (most notably his father, Ayyoub) whom he appointed to important positions throughout the government. He also sought to test the Fatamid ruler Al-Adid by publicly disrespecting him through actions, such as riding his horse into the courtyard of the Caliph's palace (something only the caliph was allowed to do). Clearly feeling secure in Egypt Saladin undertook attacks against the Kingdom of Jerusalem in 1170 and succeeded in taking the strategic town of Ayla. He withdrew early from the 1171 campaign, which was supposed to be an assault on the Crusader fortress of Karak with Nur al-Din Zangi, partially because he wanted to avoid meeting his master and officially due to the death of his father. Nur al-Din was displeased with these actions and viewed Saladin after Ayyoub's death (Ayyoub was greatly trusted by Nur al-Din and oversaw Egypt's finances on his behalf). In order to reign in his vassal and gain favor with the Abbasid Caliph, Nur al-Din commanded Saladin to overthrow the Fatimid Dynasty in June 1171. Unwilling to take more revolts, Saladin waited until Al-Adid's timely death (many suspected that al-Adid was in fact poisoned by Saladin, probably) to officially end the dynasty of the Fatamids, which he did on September 17, 1171, by having the Friday sermons across Egypt said in the name Al-Mustadi, the Abbasid caliph.
Though he did not disband the Fatimid Caliphate until 1171 Saladin actively sought to spread Sunnism as soon as he became the vizier. He established numerous mosques and madrasah in order further the spread of Sunni beliefs. This move was extremely popular amongst the majority Sunni population and by systematically appointing Sunni jurists to legal positions throughout the state Saladin tactfully eliminated any opposition he might encounter from the religious establishment when attempting to disband the Fatimid Caliphate. Another hallmark of Saladin's effective rule was his willingness to accept useful Egyptian elites into his administration. None of these were more important than Qadi al-Fadil, a brilliant jurist from Ascalon, who had served Shawar and briefly Shirkuh before coming into the service of Saladin. Men like Qadi al-Fadil provided Saladin with the more than just their ample skills, but also with direct connections into the complicated social/political circles that held power in the Fatimid State. Finally, Saladin's famed tolerance towards non-Muslims emerged when he allowed the Coptic Christians and Jews, who were deeply ingrained into Egypt's highly successful financial system, to retain their posts. This move secured the continued success of Egypt's thriving economy.
With the Fatimid Caliphate gone, Saladin now found himself the ruler of Egypt, though still a subordinate of the distant Nur al-Din. Nur al-Din, in turn, did not find himself satisfied with Saladin for a number of reasons. The greatest of these was his displeasure with the size of Saladin's tribute payments, which he had expected to be much larger. This issue was intensified by the fact that Nur al-Din had sought to advance Shirkuh, not Saladin and, with Ayyub dead, Nur al-Din felt that he had no control over the younger ruler and became ever more convinced that Saladin would attempt to become independent. The extent to which Saladin may have intentionally underpaid Nur al-Din is unknown, but it is likely that the tombs of the Pharaohs were finally running dry after being so heavily tapped by previous viziers. Saladin continued to actively avoid any personal meeting with Nur al-Din, who may very well have removed him from power. There is little doubt that Saladin's actions looked suspicious as he continued his reforms across Egyptian society, including the elimination of many taxes in contradiction with Islamic law, and began construction of a formidable navy. However, Nur al-Din was not alone in facing ambitious underlings. As other Ayyubids amassed power in Egypt, they too wished to gain territory, wealth, and glory. Among these were his nephew Taqi al-Din Umar, who expanded Saladin's domains westward to the borders of the Almohad Empire in 1173, and his brother Turanshah, who invaded Yemen and deposed its heretical leader in 1174. These maneuvers led Nur al-Din to send an auditor to Egypt to establish the appropriate amount of payments in 1173, a clear sign of distrust. With tensions mounting, 1174 proved to be a crucial year for Saladin. Early in the year, when his ambitious brother departed for Yemen, Saladin discovered a major plot to return the Fatimids to power (led by Umara ibn Abi al-Hasan al-Yamani) and dealt with the conspirators swiftly and brutally. In the meantime, Nur al-Din's patience seems to have finally worn out and he began to raise an army for the invasion of Egypt. Nur al-Din became suddenly ill and died, leaving behind a number of direct successors who lacked either the age or skill to succeed him. With Egypt as his secure power base, Saladin wasted no time in marching on Damascus, where the population welcomed him with open arms in 1174. From this point forward, his attention would be focused on Syria.