In the same year, the civil strife in the Abbasid court reached Baghdad itself: in February 865, Musta'in left Samarra along with the Turkish generals Wasif and Bugha the Younger and sought refuge in Baghdad. Back in Samarra, the rest of the Turkish military establishment raised al-Mu'tazz to the throne, and under the command of the new caliph's brother, Abu Ahmad, marched on Baghdad. The siege of Baghdad by the Samarran troops lasted for almost the entire year, and Muhammad ibn Abdallah led the defence in support of al-Musta'in.