title: Muhammad ibn Khalid ibn Barmak
text: # Muhammad ibn Khalid ibn Barmak
  
  Muhammad ibn Khalid ibn Barmak was one of the Barmakids, a family of Iranian functionaries who rose to great power under the Abbasid caliph Harun al-Rashid (r. 786–809).
  
  ## Life
  
  He was the brother of Yahya ibn Khalid, whose appointment as vizier by Caliph Harun al-Rashid in 786 began the family's twenty-year domination of the Abbasid Caliphate's public affairs. Muhammad served as the Caliph's chamberlain (hajib) from 788 to 795. He was replaced by al-Fadl ibn al-Rabi, who in the anecdotes of the time appears both as the Barmakids' foil and main antagonist at court.
  
  Muhammad also served Harun al-Rashid as governor in the Yemen and the Jazira.
  
  He was the only Barmakid to be spared during the family's abrupt fall in 803, likely because he had reported on the attempted flight of the Alid Yahya ibn Abdallah, who had been released by Yahya's son Ja'far, contrary to the Caliph's orders to have him killed.
  
  ## Family tree
  
  vteFamily tree of the Barmakids :
  
  Barmak
  
  KhalidSulaymanal-Hasan
  
  YahyaMuhammad
  
  Ja'faral-FadlMuhammadMusa
  
  al-AbbasJa'farImran
  
  Ahmad ("Jahza")
  
  Source: Barthold, W. & Sourdel, D. (1960). "al-Barāmika". In Gibb, H. A. R.; Kramers, J. H.; Lévi-Provençal, E.; Schacht, J.; Lewis, B. & Pellat, Ch. (eds.). Encyclopaedia of Islam. Volume I: A–B (2nd ed.). Leiden: E. J. Brill. pp. 1033–1036. OCLC 495469456. :
  
  