He was a minor member of the Abbasid dynasty, being a descendant of Sulayman ibn Ali, the uncle of the caliphs al-Saffah and al-Mansur.
[2] Although his jurisdictional background is obscure,[3] he was appointed as chief judge (qadi al-qudat) by al-Mutawakkil in July 854 as a replacement for Yahya ibn Aktham.
[4] His tenure in office is notable for his participation in the Arab–Byzantine prisoner exchange of 856, during which al-Hasan ibn Muhammad ibn Abi al-Shawarib acted as his deputy in Samarra.
[5] He remained in office until 863 or 864, when he was dismissed and exiled to Basra after the general Wasif al-Turki accused him of engaging with the shakiriyya troops in a suspicious manner.
[6] He was eventually allowed to return to the capital, where in 866 he unsuccessfully attempted to settle a violent dispute between the Turkish and Maghariba army regiments.