Ahmad ibn Muhammad (; 836 – 17 October 866), better known by his
regnal name (, "He who looks for help to God") was the
Abbasid Caliph from 862 to 866, during the "
Anarchy at Samarra". After the death of previous Caliph,
al-Muntasir (who had not appointed any successors), the Turkish military leaders held a council to select his successor. They were not willing to have
al-Mu'tazz or his brothers; so they elected al-Musta'in, a grandson of
al-Mu'tasim.