Al-Mustaʿin, born Ahmad ibn Muhammad in 836, was an Abbasid caliph whose reign from 862 to 866 unfolded amid the political turmoil known as the Anarchy at Samarra. A grandson of al-Muʿtasim and nephew of al-Mutawakkil, he was chosen by Turkic military leaders after the death of al-Muntasir, bypassing al-Muʿtazz and his brothers, who had been named in the previous succession plan.
Turkish officers exercised growing influence over the government during al-Mustaʿin’s rule. His accession prompted unrest in Samarra, while military setbacks in Armenia and Asia Minor and rebellions elsewhere deepened instability. In 864, his forces suppressed an uprising led by the Alid Yahya ibn Umar and a revolt in Hims. The powerful vizier Utamish was killed in 863 after falling out with rival officers, exposing the factional struggles shaping the caliphate.
In 865, al-Mustaʿin left Samarra for Baghdad amid conflict among military factions. His rival al-Muʿtazz was proclaimed caliph, and Baghdad endured a prolonged siege. As shortages and unrest mounted, al-Mustaʿin agreed to abdicate in January 866 in return for permission to retire to the Hijaz. The promised safe conduct was not honored: he remained under guard in Baghdad and was executed on October 17, 866, on al-Muʿtazz’s orders.