In 747/48, Marwan II appointed Muhammad the governor of Mecca, Medina and Ta'if in the Hejaz (western Arabia). 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 (Nahr Abi Futrus) in Palestine.