When the amir of Egypt Ahmad ibn Tulun died in 884, Muhammad was presented an opportunity to capture some of his territories in Syria from his inexperienced son and heir, Khumarawayh.
He allied himself with another Abbasid general, Ishaq ibn Kundaj, who had received authorization and some troops from al-Muwaffaq.
[4] Khumarawayh responded by sending troops to Syria, who soon succeeded in recovering the lost cities, before both sides settled into winter quarters.
[4] In the spring, al-Muwaffaq's son, Abu'l-Abbas Ahmad (the future Caliph al-Mu'tadid), arrived to take control.
Ahmad and Ishaq defeated the Tulunids, who were driven back to Palestine, but Ahmad quarrelled with Ishaq and Muhammad, who departed with their troops, and at the Battle of the Mills on 6 April Khumarawayh's general Sa'd al-Aysar routed the Abbasid army.
[2][7][8] The entire Jazira now became a Tulunid province, a fact recognized by the Abbasid government in a treaty in December 886 that confirmed Khumarawayh in his old and new possessions.
[12] At some point in his career Muhammad decided to assert his independence from the caliph, probably by refusing to send the revenue due to Baghdad.