Following the outbreak of civil war in 865 between the rival caliphs al-Musta'in (in Baghdad) and al-Mu'tazz (in Samarra), Muzahim initially sided with the former and made his way from Raqqa to Baghdad, where he was received with honor.
In the summer of 865, with the civil war still ongoing, al-Musta'in dispatched Muzahim to secure al-Kufah, which had fallen to an 'Alid rebel.