Abd al-Rahim ibn Ilyas

Abd al-Rahim ibn Ilyas ibn Ahmad ibn al-Mahdi (عبد الرحيم ابن إلياس ابن احمد بن المهدي) was a member of the Fatimid dynasty who was named heir-apparent by the caliph al-Hakim bi-Amr Allah in 1013. When al-Hakim was murdered in 1021, he was sidelined in favour of al-Hakim's son, Ali al-Zahir, arrested and imprisoned. He died in captivity, officially by his own hands, or assassinated by the real power behind al-Zahir's throne, the princess Sitt al-Mulk.

Nomination as heir-apparent
Ibn Ilyas was a descendant of the first Fatimid caliph, al-Mahdi Billah ((r. 909 – 934)). The son of a Christian woman, nothing is known of his early life until he appears in the chronicles in 1013, when the reigning caliph, al-Hakim bi-Amr Allah ((r. 996 – 1021)) chose to name him as his heir-apparent. Before the official designation, al-Hakim took care to elevate Ibn Ilyas's status. In June 1013, he wed two of Ibn Ilyas's daughters with the widows of the executed vizier, Husayn ibn Jawhar. Shortly after, during the Eid al-Adha festivities, Ibn Ilyas substituted for the caliph, and a formal proclamation as heir-apparent, with the traditional title of walī ʿahd al-muslimīn, followed in September or October of the same year. A section of the caliphal palaces was assigned to his use, his name added to the caliph's in coinage and banners, and the Fatimid army took an oath of allegiance to him. He was accorded all caliphal insignia, apart from the ceremonial parasol (miẓalla). Over the next months and years, Ibn Ilyas is frequently mentioned substituting for al-Hakim in public ceremonies and in the hearing of petitions.

This appointment was a major break with Fatimid tradition, where the oldest surviving son had always been the designated heir; it even threatened to provoke a religious schism, as father-to-son succession was a fundamental tenet of Isma'ili dogma. Indeed, in later years such irregular successions would be responsible for the major rifts in the unity of the Isma'ili community: the Nizari–Musta'li schism in 1094, and the Tayyibi–Hafizi schism in 1130. It is for this reason that male members of the Fatimid dynasty other than the caliph and his designated heir were strictly kept away from government affairs. The selection of Ibn Ilyas in particular was a surprise, since al-Hakim had two sons—Ali and al-Harith, born within a few months of each other in 905 to much fanfare—and Ibn Ilyas himself was evidently of an advanced age, and had sons of his own, and possibly even grandsons.

Moreover, al-Hakim specified that while Ibn Ilyas would become caliph (khalīfa) after his death, the position of Imam of the Isma'ili faith would pass to another distant relative, Abu Hashim al-Abbas, a great-grandson of al-Mahdi, thus separating the civilian and spiritual aspects of his office. For the Isma'ili faithful, the latter was the more important, but Abd al-Rahim was evidently the more favoured and prominent of the two, as evidenced by the different treatment meted out to the two men after al-Hakim's death. The succession arrangements were widely announced, but met with widespread criticism because of the deviation from the direct line of succession, and contributed to a rift between al-Hakim and his sister, Sitt al-Mulk. It is known that the Zirid viceroy of Ifriqiya, Badis ibn Mansur ((r. 995 – 1016)) was astonished by al-Hakim's ignoring his own sons' rights to succession. Ibn Ilyas was also perceived as an adversary by Hamza ibn Ali, an Isma'ili missionary who advocated al-Hakim's divinity and founder of the Druze sect, since God could not have a partner or a successor.

Governorship of Damascus
In 1018/19, Ibn Ilyas was appointed governor of Damascus, where he engaged in a complicated power struggle with the local Fatimid garrison, the urban militia (aḥdāth), and a short-lived replacement, Muhammad ibn Abi Talib al-Jarrar. It was only after al-Jarrar's murder that Ibn Ilyas was able to return to Damascus and establish himself as its governor, with the support of the aḥdāth.

Downfall and death
Al-Hakim disappeared—most likely assassinated by disaffected palace factions, apparently involving Sitt al-Mulk—on one of his habitual nightly rides on 13 February 1021. The caliph's disappearance was kept secret for six weeks, while the power struggle for the succession raged in the palace. In Damascus, Ibn Ilyas was apparently ignorant of events. Nevertheless, when a missive purporting to be from al-Hakim summoned him back to Cairo, he refused to obey it.

In the meantime, Sitt al-Mulk, who sponsored the succession of al-Hakim's son Ali, soon secured her position as the de facto head of the new regime, and on 26 March, during the Eid al-Adha festival, the death of al-Hakim and the succession of Ali, with the regnal name al-Zahir li-i'zaz Din Allah ((r. 1021 – 1036)), were announced. On the same day, Ibn Ilyas was arrested by a specially dispatched force in Damascus, and carried off in chains to Cairo. There he was kept in house arrest in the caliphal palace until his death sometime later. According to the official account relayed by the courtier and historian al-Quda'i, he committed suicide by thrusting a fruit knife into his belly, but, as the historian Heinz Halm notes, nobody believed this version. Rumours insisted that he had been assassinated at the instigation of Sitt al-Mulk—the murderer was reportedly the black eunuch slave Mi'dhad, a close confidant of the princess and tutor to al-Zahir—to remove the last potential rival to al-Zahir. In contrast, Abu Hashim al-Abbas was allowed to retire to obscurity, dying in peace a few years later.