Abū Muḥammad ʿAbd Allāh ibn al-Ḥusayn (Arabic: أبو محمد عبد الله بن الحسين; 31 July 874 – 4 March 934), better known by his regnal name al-Mahdī biʾllāh (Arabic: المهدي بالله, "The Rightly Guided by God"), was the founder of the Isma'ili Fatimid Caliphate, the only major Shi'a caliphate in Islamic history, and the eleventh Imam of the Isma'ili branch of Shi'ism.
He was born as Saʿīd ibn al-Ḥusayn (سعيد بن الحسين) in Askar Mukram to a family that led the secret Isma'ili missionary network (da'wa), propagating on behalf of the hidden imam, Muhammad ibn Isma'il, who would return as the prophesied Islamic messiah (mahdi). Orphaned at a young age, he moved to Salamiya, the family's base of operations, where he was adopted by his uncle. In the mid-890s Sa'id succeeded to the leadership of the expanding da'wa, which had expanded and gained adherents across the then Muslim world. However, his claims of not merely being a trustee of the hidden imam, but of him and his ancestors holding the imamate itself, led in 899 to a schism in the Isma'ili movement: those who did not recognise his claims split off to become the Qarmatians. The schism was followed by uprisings of pro-Isma'ili Bedouin in Syria in 902–903, launched without his consent by over-eager supporters, who aimed to force him to come forward as the mahdi. The Bedouin uprising was suppressed by the Abbasids, but drew the attention of the Abbasid Caliphate's authorities to him, forcing him to abandon Salamiya, and flee first to Ramla, then Fustat in Egypt, and finally Sijilmasa in what is now Morocco. There he remained, living as a merchant, until one of his missionaries, Abu Abdallah al-Shi'i, at the head of the Kutama Berbers overthrew the Aghlabid dynasty of Ifriqiya in 909.