Al-Adid

Abū Muḥammad ʿAbd Allāh ibn Yūsuf (; 1151–1171), better known by his regnal name al-ʿĀḍid li-Dīn Allāh (), was the fourteenth and last caliph of the Fatimid dynasty, and the 24th imam of Hafizi Isma'ilism, reigning from 1160 to 1171. 
Coming to the throne as a child, he spent his reign as a puppet in the hands of various strongmen who occupied the vizierate, and was a mostly helpless bystander to the collapse of the Fatimid Caliphate. In the course of his reign, both the Crusader Kingdom of Jerusalem and the Sunni Syrian ruler Nur al-Din availed themselves of the power struggles in Cairo and the enfeeblement of the Fatimid state to advance their own claims on the country. For a while, the vizier Shawar tried to play both sides off against one another, but in January 1169, Nur al-Din's general Shirkuh finally managed to overthrow Shawar and occupy Cairo. Although he died shortly after, he was followed by his nephew, Saladin, who not only consolidated his hold over Egypt, but proceeded to dismantle the Fatimid regime. Fatimid loyalists in the army were purged, and Isma'ilism was gradually abolished as the state religion in favour of Sunni Islam, culminating in the official proclamation of Abbasid suzerainty in September 1171. Al-Adid died a few days later. His family was placed under house arrest, and Isma'ilism persecuted by Saladin's new Ayyubid regime, so that within a century after the fall of the Fatimid regime it had almost disappeared in Egypt.
Origin.
The future al-Adid was born on 9 May 1151 as Abdallah, the son of the Fatimid prince Yusuf, a son of the eleventh Fatimid caliph, al-Hafiz li-Din Allah (). His father had been executed by the vizier Abbas ibn Abi'l-Futuh in 1154 after the death of Caliph al-Zafir bi-Amr Allah (), on the same day that al-Adid's five-year-old cousin, al-Fa'iz bi-Nasr Allah, was installed as caliph. 
Reign.
Al-Fa'iz was of sickly disposition, and died in 1160, aged only eleven. As al-Fa'iz had no offspring, the underage al-Adid was elevated to the throne by another all-powerful vizier, Tala'i ibn Ruzzik, on 23 July 1160. To further cement his hold over the caliph, Tala'i married him to one of his daughters. Throughout his reign, al-Adid would be little more than a figurehead monarch, effectively a puppet in the hands of courtiers and strongmen who disputed with one another over the spoils of the tottering Fatimid regime. As the French orientalist Gaston Wiet comments, "The Arab writers seem uncertain, and intermittently attribute to him stray impulses of revolt, which had little success [...] in general the caliph looked on helplessly at a shattering series of tragic incidents of which he himself was finally to be the victim". 
As a result, his personal traits are not well known. Ibn Khallikan reports that he was violently pro-Shi'a, while the only personal description of him is by the Crusader historian William of Tyre, on the occasion of an audience with Crusader leaders: his face was veiled, but his appearance was described as that of "a young man of an extremely generous disposition, whose first beard was just appearing; he was tall, of swarthy complexion and good frame".
Power struggles in Cairo and foreign interventions.
Tala'i was assassinated on 11 September 1161, possibly with the knowledge of the young caliph, as the deed was said to have been instigated by one of al-Adid's aunts. Nevertheless, his place was immediately taken by his son, Ruzzik ibn Tala'i, who likewise denied any power to the caliph. Al-Adid—or rather, a palace clique acting through him—thus turned to Shawar, the governor of Upper Egypt, for support in deposing Ruzzik. Shawar was indeed successful in capturing Cairo in February 1163, but he too assumed complete control of the government, excluding the caliph from public affairs. Shawar was soon deposed by one of his lieutenants, Dirgham, but managed to escape, and sought the assistance of the atabeg of Damascus, Nur al-Din. This was a momentous development. For Nur al-Din, whom the historian Farhad Daftary describes as a "fervent Sunni favoured by the Abbasids", Shawar's arrival opened the possibility of intervening in Egypt, not only in order to unify the core territories of the Muslim world under his rule, but also in order to overthrow the Isma'ili Shi'ite Fatimid regime and return the country to Sunni allegiance.
In the meantime, Dirgham's regime in Egypt became ever more unpopular, and he quickly lost support among the military. King Amalric of Jerusalem took advantage of the situation: already in 1161, the Crusader king had invaded Egypt and forced Tala'i to pay them tribute, and another invasion in the following year had failed only because the Fatimids had deliberately flooded the Nile. Now Amalric began to seriously consider conquering Egypt, and in the winter of 1163/64, he invaded the country with the intention of occupying it. At the same time, Nur al-Din sent an expeditionary force into Egypt under the Kurdish general Shirkuh, who was joined by his nephew, Saladin. This double foreign intervention was a momentous event in the history of the Fatimid regime and Egypt: the country, enfeebled by the constant civil wars, now became a prize in the wider struggle between Damascus and Jerusalem. 
Dirgham appealed to Amalric for help, but the King of Jerusalem was unable to intervene in time: in late April 1164, the Syrians surprised and defeated Dirgham's brother Mulham at Bilbays, opening the way to Cairo. On the news of the battle, a panic broke out in the capital of Egypt. Desperate for funds to pay his men, Dirgham confiscated the possessions of orphans, thereby provoking a public outcry against him. His troops began deserting him, including the entire "Rayhaniyya" corps. Left with only 500 horsemen, he appeared before the caliphal palace, but the caliph turned him away and advised him to save his life. As his troops continued to defect, Dirgham fled the capital, but was captured and executed.
Shawar was restored to the vizierate in August 1164, but quickly fell out with Shirkuh, and now asked for Amalric's help in driving the Syrian army out of Egypt. This strategy did indeed led to the capitulation of Shirkuh at Bilbays, and his retreat into Syria, but also left Cairo exposed to the Crusaders: Amalric besieged the Egyptian capital, forcing Shawar to set Fustat (Old Cairo) on fire, to prevent the Crusaders from seizing it. Nevertheless, in 1167, a Crusader embassy, led by Hugh of Caesarea, visited the Fatimid court and secured a substantial tribute.
Faced with this situation, it was al-Adid who now turned to Nur al-Din for assistance. In 1168, Shirkuh invaded Egypt for the third time, leading to the murder of Shawar on 18 January 1169, and his own appointment as vizier, with the title of ("the Victorious King"). On his death on 23 March, he was succeeded by his nephew, Saladin.
Saladin and the end of the Fatimid Caliphate.
As the new ruler of Egypt, Saladin quickly and ruthlessly restored order, successfully confronting the remnants of the Fatimid army in street battles in Cairo, burning down the quarters of the Black African troops, and pursuing and defeating them in Upper Egypt. Likewise, the administration was staffed with Syrians rather than Egyptians. His position secure, Saladin began to undermine the religious foundations of the Fatimid regime, both in ritual—the call to prayer was changed from the Shi'a formula back to the Sunni one, and the Friday sermon was changed to include all four Rashidun caliphs—as well as in the religious establishment, as Sunnis were appointed to all juridical posts, including that of the chief . 
This policy culminated in September 1171, when the Shafi'i jurist Najm al-Din al-Khabushani publicly proclaimed the name of the Sunni Abbasid caliph, al-Mustadi, instead of al-Adid's, and read out a list of the Fatimids' crimes. This symbolic act, that effectively restored the country to Abbasid suzerainty after two centuries of Fatimid Isma'ili rule, was met by general indifference among the Egyptian populace. The Fatimid regime was at an end, and al-Adid's death only a few days later, on 13 September 1171, after a brief illness, only sealed its demise.
After al-Adid's death, the still sizeable Isma'ili community was persecuted by Saladin's new Ayyubid regime. The members of the Fatimid family were placed under effective house arrest in the palace. Al-Adid's eldest son and designated heir, Da'ud (), was recognized by the Hafizi Isma'ili faithful as the rightful imam, but he, like his own son and successor Sulayman Badr al-Din (), lived and died in captivity. A series of abortive conspiracies and uprisings under pro-Fatimid sympathizers or Fatimid pretenders erupted in the 1170s and continued sporadically, with much diminished impact, until the end of the century. By the end of the 13th century, Isma'ilism had been effectively purged from Egypt.