Muhammad ibn Abi al-Shawarib

Abu'l-Hasan Muhammad ibn al-Hasan ibn Abdallah ibn Ali ibn Muhammad ibn Abd al-Malik ibn Abi'l-Shawarib was a 10th-century Muslim jurist who served as chief qadi of Baghdad.
Born in 904/5, Muhammad belonged to the Banu Abi'l-Shawarib family, a Hanafi legal dynasty that in the 9th and 11th centuries produced 24 qadis, including eight chief qadis, for the Abbasid caliphs. Muhammad was named chief qadi of the City of al-Mansur and of Sharqiya (West Baghdad, where the caliphal palaces were located) by caliph al-Mustakfi in September 944, shortly after his accession. At the same time, Abu Abdallah Muhammad ibn Isa served as qadi of East Baghdad. Muhammad was deposed and arrested on 16 September 945, as part of the caliph's purge of corrupt judges.
When al-Muti became caliph in January 946, he was recalled to office, as qadi of Sharqiya, the Two Holy Cities (Mecca and Medina), Yemen, Egypt, part of Syria, and the Iraqi provinces of Saqi al-Furat, Wasit and Samarra. He was dismissed again in January/February 947, and died in November/December 958. 
His brother Abdallah served as chief qadi in 961–963. 