Muhammad was a son of the Umayyad caliph Abd al-Malik and one of his slave women. According to the historian Shiv Rai Chowdhry, Muhammad and his brother al-Hajjaj were named by Abd al-Malik because their names "were the most dear" to the caliph's staunchly loyal governor of Iraq al-Hajjaj ibn Yusuf. Muhammad lived in Tiberias, the capital of Jund al-Urdunn. He had an estate at Raysun, also located in Jund al-Urdunn, which may have been granted to him by his half-brother Caliph Hisham ibn Abd al-Malik. The latter had appointed Muhammad as his first governor of Egypt on 6 March 724. He resigned over a policy difference with the caliph and was replaced by another Umayyad, al-Hurr ibn Yusuf, on 2 May 724.
Muhammad played a role in the Third Muslim Civil War, which came about following the assassination of his nephew, Caliph al-Walid II, in 744 and the subsequent accession of the leader of al-Walid's opponents within the Umayyad family, Muhammad's other nephew Yazid III. When news of al-Walid II's slaying reached the troops of Jund Filastin they deposed al-Walid II's governor, Muhammad's brother Sa'id al-Khayr, and proclaimed as their caliph Yazid ibn Sulayman, the son of Muhammad's and Sa'id's brother Caliph Sulayman. Afterward, the troops of Jund al-Urdunn, led by the grandsons of Hubaysh ibn Dulja from the Balqayn tribe, joined the rebellion against Yazid III and appointed Muhammad as their leader. Yazid III dispatched Muhammad's nephew Sulayman ibn Hisham against the rebels. According to one account, Muhammad was persuaded by Yazid III's envoys to give the caliph his allegiance. Another account holds that the caliph's troops made forays into the villages of Jund al-Urdunn and raided Tiberias, where Muhammad's residence was plundered and his weapons, horses and camels seized, after which the troops of Jund al-Urdunn offered Yazid III their allegiance in nearby Sinnabra. Afterward, Yazid III appointed his brother Ibrahim ibn al-Walid the governor of Jund al-Urdunn. A third account holds that after Yazid III appointed Ibrahim governor, the troops of Jund al-Urdunn refused to recognize him, upholding their support for Muhammad, until they were offered financial incentives to decamp.
Yazid III died later in 744 and Ibrahim acceded as caliph for a few months before abdicating to his distant cousin Marwan II. In 745 Muhammad, along with his brothers Sa'id al-Khayr and Abu Bakr Bakkar and the families of his nephews, the sons of caliphs al-Walid I, Sulayman, Yazid II and Hisham, gave his allegiance to Marwan II at Deir Ayyub in the Hauran. In 747/48, Marwan II appointed Muhammad the governor of Mecca, Medina and Ta'if in the Hejaz. He led the Hajj pilgrimage in Mecca in August 748. He was replaced as governor the following year with al-Walid ibn Urwa al-Sa'di. In the aftermath of the Abbasid Revolution, which toppled the Umayyad Caliphate in 750, Muhammad was among the dozens of Umayyads who were executed by the Abbasids at a banquet at the Antipatris river in Palestine.