death of Ibn Tulun in May 884, the two caliphal generals Ishaq ibn Kundaj and Ibn Abu'l-Saj sought to take advantage of the situation and attacked the Tulunid domains in Syria, but their initial gains were rapidly reversed. In the spring of 885, Abu'l-Abbas was sent to take charge of the invasion. He soon succeeded in defeating the Tulunids and forcing them to retreat to Palestine, but after a quarrel with Ibn Kundaj and Ibn Abu'l-Saj, the latter two abandoned the campaign and withdrew their forces. In the Battle of Tawahin on 6 April, Abu'l-Abbas confronted Ibn Tulun's son and heir, Khumarawayh, in person. The Abbasid prince was initially victorious, forcing Khumarawayh to flee, but was in turn defeated and fled the battlefield, while much of his army was taken prisoner. After this victory the Tulunids expanded their control over the Jazira and the borderlands (the Thughur) with the Byzantine Empire. A peace agreement followed in 886, whereby al-Muwaffaq was forced to recognize Khumarawayh as hereditary governor over Egypt and Syria for 30 years, in exchange for an annual tribute. Over the next couple of years, Abu'l-Abbas was involved in his father's ultimately unsuccessful attempts to wrest Fars from Saffarid control. Imprisonment and rise to the throne During this period, relations between Abu'l-Abbas and his father deteriorated, although the reason is unclear. Already in 884, Abu'l-Abbas' rioted in Baghdad against al-Muwaffaq's vizier, Sa'id ibn Makhlad, possibly over unpaid wages. Eventually, in 889, Abu'l-Abbas was arrested and put in prison on his father's orders, where he remained despite the demonstrations of the loyal to him. He apparently remained under arrest until May 891, when al-Muwaffaq returned to Baghdad after two years spent in Jibal. Al-Muwaffaq, suffering from gout, was clearly close to death; the vizier Isma'il ibn Bulbul and the city commander of Baghdad, Abu'l-Saqr, called al-Mu'tamid and his sons, including the heir-apparent al-Mufawwad, into the city, hoping to exploit the situation for their own purposes. This attempt to sideline Abu'l-Abbas failed due to his popularity with the soldiers and the common people. He was set free to visit his father's deathbed, and was able to immediately assume power when al-Muwaffaq died on 2 June. The Baghdad mob ransacked his opponents' houses, and Ibn Bulbul was dismissed and thrown in prison, where he died from maltreatment after a few months. Similar fates awaited any of Ibn Bulbul's supporters who were caught