and further south the Qarmatians were a nascent threat. Al-Muwaffaq's regency was thus a continuous struggle to save the tottering Caliphate from collapse. His attempts to recover control of Egypt and Syria from Ibn Tulun failed, with the latter even able to expand his territory and obtain recognition as a hereditary ruler, but he succeeded in preserving the core of the Caliphate in Iraq by repelling a Saffarid invasion aimed at capturing Baghdad, and by subduing the Zanj after a long struggle. Campaigns against the Zanj and the Tulunids It was against the Zanj that the future al-Mu'tadid—at this time usually referred to by his of Abu'l-Abbas—would acquire his first military experience and establish the close army ties that would characterize his reign. Al-Muwaffaq gave his son a military upbringing from an early age, and the young prince became an excellent rider and a solicitous commander, who showed personal attention to the state of his men and their horses. Within a decade of the outbreak of the revolt in 869, the Zanj had seized most of lower Iraq, including the cities of Basra and Wasit, and expanded into Khuzistan. In 879 the death of the founder of the Saffarid state, Ya'qub al-Saffar, allowed the Abbasid government to fully concentrate its attention against the Zanj rebellion, and Abu'l-Abbas' appointment to command in December 879 at the head of 10,000 troops marks the turning point of the war. In the long and hard struggle that followed, which involved amphibious operations in the Mesopotamian Marshes, Abu'l-Abbas and his own —of which the long-serving Zirak al-Turki was the most eminent—played the major role. Although the Abbasid armies eventually swelled with reinforcements, volunteers, and Zanj defectors, it was the few but elite who formed the army's backbone, filling its leadership positions and bearing the brunt of the battle, often under the personal command of Abu'l-Abbas. After years of gradually tightening the noose around the Zanj, in August 883 the Abbasid troops stormed their capital of al-Mukhtara, putting an end to the rebellion. A detailed account of the war by a former Zanj rebel, preserved in the history written by al-Tabari, stresses the role of al-Muwaffaq and Abu'l-Abbas as the heroes who, in defence of the embattled Muslim state, suppressed the rebellion; the successful campaign would become a major tool in their propaganda effort to legitimize their de facto usurpation of the caliph's power. Following the