The accession of al-Mu'tamid brought an end to the turmoils of the "Anarchy at Samarra", which had begun with the murder of al-Mutawakkil in 861.
Caliphal authority in the provinces collapsed during that period, with the result that the central government lost effective control over most of the Caliphate outside the metropolitan region of Iraq.
In the west, Egypt had fallen under the control of the ambitious Turkish soldier Ahmad ibn Tulun, who also had designs on Syria, while Khurasan and most of the Islamic East had been taken over by the Saffarids under Ya'qub ibn al-Layth, who replaced the Abbasids' loyal client state, the Tahirids.
Most of the Arabian peninsula was likewise lost to local potentates, while in Tabaristan a radical Zaydi Shi'a dynasty took power.
Even in Iraq, a rebellion of the Zanj slaves had begun and soon threatened Baghdad itself, while further south the Qarmatians were a nascent threat.
In addition, al-Mu'tamid's position was undermined from within, as during the coups of the previous years real power had come to lie with the elite Turkish troops, and with al-Mu'tamid's brother Abu Ahmad Talha, who, as the Caliphate's main military commander, served as the chief intermediary between the caliphal government and the Turks.
When Caliph al-Mu'tazz died in 869, there was even popular agitation in Baghdad in favour of his elevation to Caliph.

In contrast to his brother, al-Mu'tamid appears to have lacked any experience of, and involvement in, politics, as well as a power base he could rely on.
At the time al-Muhtadi was killed by the Turks, Abu Ahmad was at Mecca.
Immediately he hastened north to Samarra, where he and Musa ibn Bugha effectively sidelined al-Mu'tamid, and assumed control of the government.
Al-Mu'tamid was thus quickly reduced to a figurehead ruler, which remained the case for the remainder of his reign.
Within a short time, Abu Ahmad was conferred an extensive governorate covering most of the lands still under caliphal authority: western Arabia, southern Iraq with Baghdad, and Fars.
To denote his authority, he assumed an honorific name in the style of the caliphs, al-Muwaffaq bi-Allah.
As one of the few vestiges of actual power, al-Mu'tamid retained the right to appoint his own viziers, originally choosing the experienced Ubayd Allah ibn Yahya ibn Khaqan, who had already served al-Mutawakkil.
During his caliphate, the Caliph retained some freedom of action, but after his death in 877, he was replaced by al-Muwaffaq's secretary, Sulayman ibn Wahb.
Ibn Wahb was soon disgraced and replaced as vizier by Isma'il ibn Bulbul.
Real power however lay again with al-Muwaffaq's new secretary, Sa'id ibn Makhlad, until his own disgrace and downfall in 885, after which Ibn Bulbul became the sole vizier to both al-Mu'tamid and al-Muwaffaq.

On 20 July 875, al-Mu'tamid formally arranged for the governance of the state and his succession: his underage son Ja'far was given the honorific name al-Mufawwad ila-llah, was named heir-apparent and assigned the western half of the Caliphate—Ifriqiya, Egypt, Syria, the Jazira and Mosul, Armenia, Mihrajanqadhaq and Hulwan— while al-Muwaffaq received the eastern provinces and was named second heir, except for the event that the Caliph died while al-Mufawwad was still a minor.
In practice, al-Mufawwad never exercised any real authority, and al-Muwaffaq continued to exercise control over the western provinces as well through his trusted lieutenant Musa ibn Bugha, who was named al-Mufawwad's deputy.
Al-Muwaffaq's power was strengthened by the military threats the Caliphate faced on all fronts, since he commanded the loyalty of the army.
In April 876, al-Muwaffaq and Musa ibn Bugha defeated Ya'qub ibn al-Layth's attempt to capture Baghdad at the Battle of Dayr al-'Aqul and saved the Caliphate from collapse.
The repulse of the Saffarids then allowed the Abbasids to concentrate their resources in suppressing the Zanj Revolt in the south.
The Zanj rebels had managed to capture much of lower Iraq, and inflicted several defeats on the Abbasid troops.
In 879, al-Muwaffaq's son
The accession of al-Mu'tamid brought an end to the turmoils of the "Anarchy at Samarra", which had begun with the murder of al-Mutawakkil in 861. Caliphal authority in the provinces collapsed during that period, with the result that the central government lost effective control over most of the Caliphate outside the metropolitan region of Iraq. In the west, Egypt had fallen under the control of the ambitious Turkish soldier Ahmad ibn Tulun, who also had designs on Syria, while Khurasan and most of the Islamic East had been taken over by the Saffarids under Ya'qub ibn al-Layth, who replaced the Abbasids' loyal client state, the Tahirids. Most of the Arabian peninsula was likewise lost to local potentates, while in Tabaristan a radical Zaydi Shi'a dynasty took power. Even in Iraq, a rebellion of the Zanj slaves had begun and soon threatened Baghdad itself, while further south the Qarmatians were a nascent threat. In addition, al-Mu'tamid's position was undermined from within, as during the coups of the previous years real power had come to lie with the elite Turkish troops, and with al-Mu'tamid's brother Abu Ahmad Talha, who, as the Caliphate's main military commander, served as the chief intermediary between the caliphal government and the Turks. When Caliph al-Mu'tazz died in 869, there was even popular agitation in Baghdad in favour of his elevation to Caliph.
In contrast to his brother, al-Mu'tamid appears to have lacked any experience of, and involvement in, politics, as well as a power base he could rely on. At the time al-Muhtadi was killed by the Turks, Abu Ahmad was at Mecca. Immediately he hastened north to Samarra, where he and Musa ibn Bugha effectively sidelined al-Mu'tamid, and assumed control of the government. Al-Mu'tamid was thus quickly reduced to a figurehead ruler, which remained the case for the remainder of his reign. Within a short time, Abu Ahmad was conferred an extensive governorate covering most of the lands still under caliphal authority: western Arabia, southern Iraq with Baghdad, and Fars. To denote his authority, he assumed an honorific name in the style of the caliphs, al-Muwaffaq bi-Allah. As one of the few vestiges of actual power, al-Mu'tamid retained the right to appoint his own viziers, originally choosing the experienced Ubayd Allah ibn Yahya ibn Khaqan, who had already served al-Mutawakkil. During his caliphate, the Caliph retained some freedom of action, but after his death in 877, he was replaced by al-Muwaffaq's secretary, Sulayman ibn Wahb. Ibn Wahb was soon disgraced and replaced as vizier by Isma'il ibn Bulbul. Real power however lay again with al-Muwaffaq's new secretary, Sa'id ibn Makhlad, until his own disgrace and downfall in 885, after which Ibn Bulbul became the sole vizier to both al-Mu'tamid and al-Muwaffaq.
On 20 July 875, al-Mu'tamid formally arranged for the governance of the state and his succession: his underage son Ja'far was given the honorific name al-Mufawwad ila-llah, was named heir-apparent and assigned the western half of the Caliphate—Ifriqiya, Egypt, Syria, the Jazira and Mosul, Armenia, Mihrajanqadhaq and Hulwan— while al-Muwaffaq received the eastern provinces and was named second heir, except for the event that the Caliph died while al-Mufawwad was still a minor. In practice, al-Mufawwad never exercised any real authority, and al-Muwaffaq continued to exercise control over the western provinces as well through his trusted lieutenant Musa ibn Bugha, who was named al-Mufawwad's deputy. Al-Muwaffaq's power was strengthened by the military threats the Caliphate faced on all fronts, since he commanded the loyalty of the army. In April 876, al-Muwaffaq and Musa ibn Bugha defeated Ya'qub ibn al-Layth's attempt to capture Baghdad at the Battle of Dayr al-'Aqul and saved the Caliphate from collapse. The repulse of the Saffarids then allowed the Abbasids to concentrate their resources in suppressing the Zanj Revolt in the south. The Zanj rebels had managed to capture much of lower Iraq, and inflicted several defeats on the Abbasid troops. In 879, al-Muwaffaq's son
Al-Mu'tamid