The accession of al-Hafiz signalled the restoration of the Fatimid dynasty and the figure of the caliph, but the preceding events had shaken the regime's foundations. The new caliph enjoyed little authority over the army, and al-Hafiz's reign was marred by chronic instability, having to fend off rebellions and challenges to his legitimacy from ambitious warlords, and even from within his own family. To bolster his legitimacy, al-Hafiz resorted, among other things, to converting the Shi'a festival of
Ghadir Khumm into a festival celebrating the Fatimids. Despite his weak position, al-Hafiz succeeded in remaining on the throne for almost two decades. Al-Hafiz continued the practice of appointing viziers to run the government in his name, but the power concentrated into the office's hands since the days of Badr al-Jamali made it a danger even to the caliph, and al-Hafiz paid particular attention to his viziers' activities. Indeed, for the last decade of his reign, he did not appoint any viziers, but instead relied on high-ranking clerks as
ad hoc directors of government affairs.
Vizierate of Yanis and first personal regime, 1132–1134 in His first vizier was the Armenian Yanis, a former military slave of al-Afdal and thus a prominent member of the same army factions that had raised Kutayfat to power. Yanis had already occupied high offices under al-Amir, including chamberlain (), a post almost as powerful as the vizierate. To enforce his own authority, he executed half of al-Amir's bodyguard and formed a private army, the . His growing power alarmed the Caliph. When Yanis died in late 1132, after nine months in office, it was rumoured that the Caliph had had him poisoned. After Yanis' death, the powerful position of vizier was deliberately left vacant. Al-Hafiz also dismissed Yuhanna ibn Abi'l-Layth, the long-serving head of the ('bureau of verification'), responsible for overseeing the financial administration. The Caliph used the opportunity to enlist the support of the families (those claiming descent from Muhammad) by appointing the Mu'tamid al-Dawla as head of the , and his brother as ('head representative of the '). Al-Hafiz also had to confront a revolt of troops in the eastern
Nile Delta, as well as an unexpected danger: al-Husayn, one of the sons of Nizar (the eponymous cause of the Nizari schism) who had fled to the
Maghreb upon his father's execution, left his exile to return to Egypt. He gathered an army, but al-Hafiz successfully bribed one of his officers to assassinate him before he reached the country. At the same time, the Caliph sought to bolster Fatimid credentials in the eyes of the Muslim world by once again taking up the mantle of champions of the against the
Crusader Kingdom of Jerusalem, as had been the case under al-Afdal. Taking advantage of the revolt of
Hugh II of Jaffa against King
Fulk of Jerusalem (), after a long hiatus caused by the
loss of Tyre in 1124, the Fatimids resumed their attacks on the Crusader territories from their stronghold at Ascalon. As a result, Fulk was forced to construct a series of new castles—
Chastel Arnoul (1133),
Beth Gibelin (1137),
Ibelin (1141), and
Blanchegarde (1142)—to protect the Jaffa–Jerusalem road and provide security for Western settlers. These fortresses shifted the balance in the Crusaders' favour, as they forced the Fatimid garrison of Ascalon into a defensive stance. With the fortification of
Gaza in 1150, Ascalon was entirely cut off by land, paving the way for
its capture by the Crusaders in 1153.
Vizierates of al-Hafiz's sons, 1134–1135 In 1134, al-Hafiz appointed his own son and designated heir,
Sulayman, as vizier. A move designed to further strengthen the dynasty, it backfired disastrously when Sulayman died two months later, thereby once more throwing doubt on the supposed infallibility of the caliph-imam. Sulayman's younger brother
Haydara was immediately appointed as heir and vizier, but this provoked the jealousy of another of al-Hafiz's sons,
Hasan. Hasan won the backing of the , a regiment of apparently Armenian origin established by Badr and al-Afdal that had been the pillar of their power and that had also supported Kutayfat. The Caliph and Haydara were backed by the
Black African regiment of the . This dissension appears to have had religious motivation as well, as Hasan and his followers are said to have backed Sunnism and attacked Isma'ili preachers. On 28 June, the defeated the , forcing Haydara to flee to the palace, which was now besieged by Hasan's troops. Faced with this unprecedented situation, al-Hafiz backed down and on 19 July, he appointed Hasan as vizier and heir. As the historian
Michael Brett comments, al-Hafiz had effectively appointed his son "in opposition to himself". To secure his position, Hasan organized a private militia, the , with which he terrorized the elites. Al-Hafiz instigated the Black African garrison of
Upper Egypt to try and depose his son, but again Hasan's men emerged victorious. In the end, it was Hasan's tyrannical rule that caused his downfall. His brutal treatment of his enemies, the executions of prominent men and the confiscation of property, cost him whatever support he may have had. It was said that as many as 15,000 people were killed in the turmoils caused by Hasan's rule. Following the murder of several senior commanders, the army rose in revolt in March 1135. Hasan fled to the caliphal palace, where al-Hafiz placed him under arrest. The troops then assembled at the square before the palace and demanded his execution, otherwise threatening to set fire to the palace. Al-Hafiz called to his rescue the governor of the Gharbiyya province (the western Nile Delta),
Bahram al-Armani. Before Bahram could arrive in the capital, the Caliph bowed to the soldiers' demands and had his son poisoned by his Jewish physician.
Vizierate of Bahram, 1135–1137 Arriving in Cairo soon after the murder of Hasan, Bahram al-Armani, although a Christian, was named vizier on 4 April 1135 and received the title of 'Sword of Islam' (). The appointment of a Christian to the post of vizier provoked much opposition among the Muslims, as the office was seen as the representative of the imam-caliph, and entailed ritual roles in Islamic ceremonies and precedence over Muslim clerics. Al-Hafiz persisted with his appointment, but gave Bahram a dispensation to absent himself from ritual ceremonies, in which the vizier's role was taken by the chief . He also did not receive those customary titles of the Fatimid viziers that implied control over the Muslim religious establishment ( and ). The Muslim population continued to oppose Bahram because he showed favour to Christians of all denominations, permitted the conferment of privileges on churches and the construction of new ones, and encouraged Armenian immigration, which in a short time is said by medieval sources to have reached 30,000 people. His brother, Vasak, was appointed governor of
Qus in Upper Egypt, and his government was blamed by contemporaries for being tyrannical towards the local population. In foreign policy, Bahram's tenure inaugurated a period of peace, since the Crusader states of the Levant were occupied with the growing threat of
Zengi, the Turkish
atabeg of
Mosul. Bahram even presided over the release of 300 captives held since the
Battle of Ramla in 1102. The vizier appears to have entertained good relations, and possibly formed an alliance, with King
Roger II of Sicily. In the meantime, the Muslim backlash against Bahram grew. His post as vizier was already considered an insult, but the favour shown to Christians, the Armenian immigration, and his close relations with Christian powers further inflamed passions. Ridwan ibn Walakhshi, the Caliph's former gaoler, emerged as the movement's leader. Ridwan was a Sunni who had risen to be one of the leading military commanders under al-Amir, and now held the position of . Bahram tried to dispose of him by sending him to govern Ascalon in May 1135, but there Ridwan busied himself with blocking Armenian immigration, earning plaudits from the Muslim public opinion in Cairo. As a result, Bahram recalled him in November 1136 and sent him to govern his own former province at Gharbiyya. The move backfired, as Ridwan was now placed in possession of an independent power base. Leading Cairene officials began making contact with him, and Ridwan did not hesitate to preach against Bahram from the pulpit of the mosque. Finally, in early 1137 Ridwan raised an army from the local Bedouin and marched on Cairo. Bahram's Muslim soldiers deserted him, and on 3 February he fled Cairo with 2,000 Armenian soldiers, making for Qus. After his departure, an anti-Armenian
pogrom broke out in the capital, and even the vizieral palace was plundered. At Qus, Bahram found his brother killed and defiled by the local townfolk. In revenge, Bahram plundered the city, but resisted calls to torch it so as not to fully alienate the caliph. He then made for
Aswan on the southern border of the Fatimid realm—some sources claim that he had intended to found a new realm allied with the Christian kingdoms of
Nubia to the south—but the local governor barred his gates to him, and Bahram was forced to retreat to
Akhmim. There a letter from al-Hafiz reached him, offering lenient terms: he could choose either a governorship at Qus, Akhmim, or
Asyut, but could keep only a fraction of his followers, or he could enter a monastery near Akhmim, with a letter of protection () for himself and his relatives. Bahram chose the latter.
Regime of Ridwan, 1137–1139 The Caliph's leniency towards Bahram is not surprising, as the Christian vizier was not nearly as threatening to his own position as the Sunni
Ridwan ibn Walakhshi, who "promised to be a second
Nasir al-Dawla, threatening to turn the country over, not to Twelver Shi'ism like Kutayfat, but to Sunnism". Indeed, when Ridwan took office on 5 February 1137, his titles reflected his dangerously powerful position. The new vizier was, like Bahram, the 'Sword of Islam', and once again, being a Muslim, head of the s () and the s (). Instead of 'Most Mighty and Excellent Lord' (), he was now 'Most Excellent King' (), signalling his status as a monarch effectively independent of the imam–caliph. Ridwan's appointment thus marks the culmination of a process that made the Fatimid viziers into sultans, similar to the relationship of the
Seljuk rulers vis-à-vis the
Abbasid caliphs since the time of
Tughril (). Now vizier, Ridwan launched an anti-Christian persecution. Christian officials were replaced with Muslims, their properties confiscated, and some were executed. Restrictive and discriminatory
sumptuary laws and regulations were introduced for Christians and Jews, such as requiring them to wear specific clothes and to dismount when passing by a mosque, or prohibiting them from riding horses, but only donkeys and mules. The poll tax () was redefined, and was now required to be paid to a bench set at the height of the head, as a sign of inferiority. Bahram's Armenian troops were disbanded, either settled as peasants or allowed to leave Egypt and return to their homeland. At the same time, Ridwan promoted Sunnism: a
Shafi'i was established on the Syrian model in
Alexandria, where Sunnism was more widespread than the capital. Ridwan also continued correspondence with the
Burids, a Turkish dynasty that ruled southern Syria, particularly
Shams al-Dawla Muhammad of
Baalbek, for a common front against the Crusaders, but also possibly with the aim of using the Sunni Syrians to unseat the Fatimid dynasty. In 1138 Ridwan attempted to remove al-Hafiz from power altogether by consulting a Sunni (the head of the Alexandria , Ibn Awf), a Twelver (Ibn Abi Kamil), and an Isma'ili jurist (the chief
Isma'il ibn Salama) on the possibility of deposing al-Hafiz. Their answers were fairly predictable: Ibn Abi Kamil argued that the claim to the imamate by al-Hafiz and his ancestors was false, Ibn Salama supported the Caliph, and Ibn Awf took a more cautious stance and advised that the deposition should be handled in accordance with religious law. Ridwan began arresting and executing members of the Caliph's entourage, while al-Hafiz demonstratively recalled Bahram from exile and allowed him to settle in the palace. Ridwan in turn appeared in public on the
Eid al-Fitr on 31 May wearing a robe in a style normally reserved for monarchs. gate in Cairo, photographed in 1867 Matters came to a head on 8 June, as al-Hafiz, enthroned atop the Golden Gate of the palace, engaged in a heated exchange with Ridwan below. The vizier then ordered the palaces surrounded by troops, and presented one of the Caliph's sons, aiming to place him on the throne. This failed as the palace remained closed to him, and due to the resistance of Ibn Salama, who insisted that only the imam could sanction his successor by conferring upon him. This impasse allowed al-Hafiz to regain the initiative. The turncoat son and his followers were killed, and on 12 June a group of twenty men of the caliphal bodyguard entered the city through the
Bab Zuwayla gate shouting "al-Hafiz, the Victorious" (). They were quickly joined by the populace and the bulk of the army, which rose in revolt against Ridwan. It was only with the assistance of his brother and nephew, and some loyal troops of the , that Ridwan was able to break through and escape the city via the
Bab al-Nasr (Victory Gate). The vizier's palace was once more plundered by the mob behind him. Aided by the Bedouin in his employ, Ridwan fled to Ascalon and thence to the Burid domains. The Burid governor of
Salkhad,
Kumushtakin, gave him a force of Turks, with whom he returned to Egypt. Rallying the Bedouin around him, he marched on Cairo, but was repulsed in front of the city gates on 28 August 1139. A month later, al-Hafiz led his army, comprising the and regiments and his own bodyguard, to defeat Ridwan's forces. Ridwan fled to Upper Egypt, but soon had to surrender himself to the Caliph's forces in exchange for an . Al-Hafiz had Ridwan interned in the palace, in the room next to Bahram's.
Return to personal rule, 1139–1149 After Ridwan's downfall, al-Hafiz offered to reappoint Bahram as vizier, but the latter refused. He remained al-Hafiz's closest aide, however, and on his death in November 1140, al-Hafiz participated in the funeral cortège in person. For the remainder of his reign, al-Hafiz did not appoint another vizier, but rather chose secretaries () to lead the administration. At some point in 1139/40, the Berber
Salim ibn Masal was appointed as leading minister, but the title of vizier was deliberately avoided, and he was instead titled 'supervisor of affairs' () or 'supervisor of the public interests' (). Ibn Masal would be named vizier only after al-Hafiz's death. This was a deliberate attempt to reverse the progressive transformation of the vizierate into a sultanate: unlike the viziers, the secretaries were civilian bureaucrats without ties to the army, and often non-Muslims as well, and hence utterly dependent on the Caliph. The first of these secretaries was the Egyptian Christian
Abu Zakari, who had been appointed as 'supervisor of the bureaus' (, likely indicating the head of the ) by Bahram and been dismissed and exiled by Ridwan. Al-Hafiz restored him to his position, and awarded him the title 'Protege of the Caliphate' (). He appears to have used his position as head of the fiscal administration to
contract for tax revenues and appropriate the surplus income for himself. As a result, in 1145 he was arrested and executed at the Caliph's orders along with his father and brother. Muslim writers denigrated Abu Zakari as 'the Slit-Nosed One' (), twisting his honorific :wikt:أكرم#Arabic| ('the Most Noble One'). This anti-Christian animus perhaps explains why his two successors were both Muslim s who had served under Ridwan. The first,
Abu'l-Karam al-Tinnisi, received the title of 'the Successful One' (), and held the post for two years, until September 1147. He was replaced by
Muhammad ibn al-Husayn al-Tarabulusi, surnamed 'the Chosen One' (). Al-Tarabulusi was also appointed head of the
chancery, and given quasi-vizieral prerogatives: he was allowed to wear the tail of his turban () in a style reserved for palace eunuchs, and attended the caliph at the
Friday prayer. In foreign affairs, al-Hafiz's final decade was largely peaceful. Both the Fatimids and the Kingdom of Jerusalem were focused on internal troubles, and the Crusaders were preoccupied with Zengi. In April/May 1141, Crusader knights appeared before Ascalon, but were chased away by the Fatimid garrison. In 1142/3, Fatimid envoys visited the court of Roger II of Sicily. Roger pursued
expansionist plans against the former Fatimid domains in Ifriqiya, now ruled by the
Zirid dynasty, and his fleet had recently captured the old Fatimid capital of
al-Mahdiya there. Despite the possible danger posed by the Christian expansion into North Africa, and incidents where Norman warships captured Egyptian merchant vessels, relations remained cordial. The chronicler
Romuald of Salerno even records the conclusion of a commercial treaty between Egypt and Sicily in 1143. According to Halm, Roger's decision to abstain from the
Second Crusade (1147–1150) may have played a role in maintaining friendly relations until both monarchs died. The historian Jeremy Johns points out that while the Fatimids had long lost the ability to intervene directly in Ifriqiya, they adopted a "
laissez-faire" attitude towards Norman expansion since the kings of Sicily, a "trading partner of proven worth", promised "restoration of law and order along the North African coast", which would be of benefit to Egyptian commerce. Johns also points out that even many of the trade networks linking the
Indian Ocean and
Red Sea to Egypt and the Mediterranean appear to have been in the hands of Sicilian and Ifriqiyan merchants at this time, which may further explain Cairo's interest in the Norman venture. In 1139/40, al-Hafiz sent envoys to the Zurayid ruler of Aden,
Ali ibn Saba ibn Abu'l-Su'ud, to formally invest him as for Yemen. By the time the Fatimid envoy arrived, Ali had died, so the investiture passed to his brother and successor,
Muhammad. Another embassy to Yemen is recorded in 1144, most likely again heading to Aden. In September 1147, a Fatimid embassy arrived in Damascus, apparently in an attempt to make common cause with its ruler,
Unur, against the ambitions of Zengi's son,
Nur al-Din. Given the continuing troubles in Egypt, however, any thought of a Fatimid intervention in Syria remained an impossibility. The last years of al-Hafiz's reign were dominated by domestic challenges that laid bare the unstable foundations of his authority. In 1144/5, one of al-Hafiz's uncles, Abu'l-Husayn, tried to gain the support of the for his own bid to the caliphate, promising to make him vizier as a reward. The , Khumartash, informed al-Hafiz, who had his uncle thrown into prison. In 1146, the commander Bakhtiyar rebelled in Upper Egypt, but was defeated by a force of
Luwata Berbers from the
Western Desert. In May 1148, Ridwan managed to escape from his confinement in the palace, cross the Nile, and rally followers to his banner, including Bedouin, regular soldiers, and Luwata. With this army he marched once more on Cairo, defeated the Caliph's troops and pursued them into the city itself. Al-Hafiz barred the gates of the palace, but pretended to be cooperative, and even sent money when Ridwan asked for it to pay his men. At the same time, the Caliph selected ten Black African members of the caliphal bodyguard to assassinate Ridwan. Shouting "al-Hafiz, the Victorious", they attacked and killed him and his brother near the
Aqmar Mosque. In 1149, another pretender, a supposed son of Nizar, gathered Berber supporters—Luwata and even some
Kutama, once the mainstay of the early Fatimid dynasty—to attack Alexandria. The rebels scored a victory against the first army sent to confront them, but the rebellion was ended when al-Hafiz bribed the Luwata chieftains to withdraw with money and promises of land grants in the Nile Delta. The pretender's severed head was sent to Cairo. In 1149, the rival military factions, the and the , once again clashed in the streets of Cairo, so that people were afraid to enter the capital. The emerged victorious and drove their opponents out of the city to
Giza. These years were also ones of natural disasters. The
Nile floods were particularly low in 1139, while famine and pestilence ravaged Egypt in 1142. In 1148, the Nile flood was too high, with the water reaching to the gates of Cairo. ==Death and legacy==