Muhammad ibn al-Mustakfi

Abu'l-Hasan Muhammad ibn al-Mustakfi (أبو الحسن محمد بن المستكفي) was a son of the Abbasid caliph al-Mustakfi ((r. 944 – 946)). He was designated as his father's heir, and a few coins were minted at Baghdad with his name before his father was overthrown by the Buyids in early 946.

Muhammad fled to the Ikhshidid court in Egypt, from where he launched a covert propaganda effort against the Buyids and the caliph installed by them, al-Muti. In this he obscured his real identity, assuming the mantle of the Mahdi, the expected Islamic messiah, and his messages were apparently well received by both Sunnis and Shia in Iraq, including in Baghdad itself. These efforts were intensified after the death of the Buyid conqueror of Baghdad, Mu'izz al-Dawla, in 967. His chief convert was none other than the Buyid commander of Baghdad, the Turk Sübüktegin al-Ajami, who invited him into the city, gave him protection and was preparing to mount a coup in his name, before his identity was uncovered and he was handed over to al-Muti. The Caliph did not severely punish him, other than ordering his nose cut off, thereby disqualifying him from the succession; Muhammad eventually managed to escape, but his hopes of seizing the throne were never realized.