Musa ibn Atamish. At some point after his takeover of Syria, Ibn Tulun ordered the refortification of Akka, a task undertaken by Abu Bakr al-Banna, the grandfather of al-Muqaddasi, who provides a detailed description of the work. Only then, in April 879, did Ibn Tulun return to Egypt. Abbas fled west with his supporters, and from Barqa tried to take over Ifriqiya. Defeated by the Ifriqiyans (probably in the winter of 880–881), he retreated back east to Alexandria, where he was finally confronted and captured by Ibn Tulun's forces. After being publicly paraded seated on a mule, Ibn Tulun ordered his son to execute or mutilate his companions, who had driven him to rebel. Ibn Tulun reportedly secretly hoped that his son would refuse to do such a dishonourable act, but he agreed. Weeping, Ibn Tulun had Abbas whipped and imprisoned. He then named his second son, Khumarawayh, as his heir-apparent. Final years and death Following his return from Syria, Ibn Tulun added his own name to coins issued by the mints under his control, along with those of the Caliph and heir apparent, al-Mufawwad. In the autumn of 882, the Tulunid general Lu'lu' defected to the Abbasids. At the same time, the Tulunid-appointed governor of Tarsus and the Thughur died, and his replacement, Yazaman al-Khadim, with popular backing, refused to acknowledge Tulunid rule. Ibn Tulun immediately left in person for Syria—taking the chained Abbas with him as a precaution—and headed for Tarsus. At Damascus, he received a message from al-Mu'tamid informing him that the by-now nearly powerless Caliph had escaped Samarra and was heading for Syria. Taking custody of al-Mu'tamid would have immensely boosted Ibn Tulun's standing: not only would the sole source of political legitimacy in the Muslim world reside under his control, but he would also be able to pose as the "rescuer" of the Caliph. Ibn Tulun therefore decided to halt and await al-Mu'tamid's arrival. In the event, however, the Caliph was overtaken at al-Haditha on the Euphrates by the governor of Mosul, Ishaq ibn Kundaj, who defeated the caliphal escort and brought him back to Samarra (February 883) and thence south to Wasit, where al-Muwaffaq could better control him. This opened anew the rift between the two rulers: al-Muwaffaq nominated Ishaq ibn Kundaj as governor of Egypt and Syria—in reality a largely symbolic appointment—while Ibn Tulun organized an assembly of religious jurists at Damascus which