Ḥasan ibn al-Ḥāfiẓ was a younger son of the eleventh Fatimid caliph and imam of Hafizi Isma'ilism, al-Hafiz, and vizier and heir-apparent of the Fatimid Caliphate from 19 July 1134 until his death in March 1135. Hasan came to power rebelling against his own father, and had allegedly espoused Sunnism. His reign was marked by brutality and repression which cost him support, and sparked another uprising that resulted in his downfall. He was poisoned by al-Hafiz, and succeeded by Bahram al-Armani.
Hasan was a younger son of the Fatimid caliph al-Hafiz . The legitimacy of al-Hafiz' rule was challenged, as he had succeeded his cousin, al-Amir, in a coup. This led to a schism among the Isma'ili faithful, dividing them into the Hafizi and Tayyibi branches.
In 1134, in an attempt to consolidate the line of succession, al-Hafiz appointed his eldest son, Sulayman, both as heir-apparent and as vizier (head of government). It was the first time that a Fatimid prince, or even the heir-apparent, had been appointed to the vizierate. Sulayman died after only two months, once more calling into question the supposed infallibility of al-Hafiz as the Isma'ili imam, and thus his legitimacy. Sulayman's younger brother Haydara was immediately appointed as heir and vizier, but this provoked the jealousy of Hasan.
Hasan won the backing of the regiment, apparently recruited from Armenians, while al-Hafiz and Haydara were backed by the Black African regiment of the . The military factionalism appears to have had religious motivation as well, as Hasan and his followers are said to have backed Sunnism and to have attacked Isma'ili preachers. On 28 June 1134, the defeated the, forcing Haydara to flee to the caliphal 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 submitted to the soldiers' demands and had his son poisoned by his Jewish physician. The troops did not disperse until one of them was invited in to inspect the body. For good measure, he stabbed it several times with a knife before departing.