The Fourth Fitna, Fourth Muslim Civil War, or Great Abbasid Civil War resulted from the conflict between the brothers al-Amin and al-Ma'mun over the succession to the throne of the Abbasid Caliphate. Their father, Caliph Harun al-Rashid, had named al-Amin as the first successor, but had also named al-Ma'mun as the second, with Khorasan granted to him as an appanage. Later a third son, al-Qasim, was designated as third successor. After Harun died in 809, al-Amin succeeded him in Baghdad. Encouraged by the Baghdad court, al-Amin began trying to subvert the autonomous status of Khurasan, and al-Qasim was quickly sidelined. In response, al-Ma'mun sought the support of the provincial élites of Khurasan and made moves to assert his own autonomy. As the rift between the two brothers and their respective camps widened, al-Amin declared his own son Musa as his heir and assembled a large army. In 811, al-Amin's troops marched against Khurasan, but al-Ma'mun's general Tahir ibn Husayn defeated them in the Battle of Ray, and then invaded Iraq and besieged Baghdad itself. The city fell after a year, al-Amin was executed, and al-Ma'mun became Caliph.

Al-Ma'mun chose to remain in Khorasan, however, rather than coming to the capital. This allowed the power vacuum which the civil war had fostered in the Caliphate's provinces to grow, and several local rulers sprang up in Jazira, Syria and Egypt. In addition, a series of Alid uprisings occurred, beginning with Abu'l-Saraya at Kufa and spreading to southern Iraq, the Hejaz, and Yemen. The pro-Khorasani policies followed by al-Ma'mun's powerful chief minister, al-Fadl ibn Sahl, and al-Ma'mun's eventual espousal of an Alid succession in the person of Ali al-Ridha, alienated the traditional Baghdad élites, who saw themselves increasingly marginalized. Consequently, al-Ma'mun's uncle Ibrahim was proclaimed rival caliph at Baghdad in 817, forcing al-Ma'mun to intervene in person. Fadl ibn Sahl was assassinated and al-Ma'mun left Khorasan for Baghdad, which he entered in 819. The next years saw the consolidation of al-Ma'mun's authority and the re-incorporation of the western provinces against local rebels, a process not completed until the pacification of Egypt in 827. Some local rebellions, notably that of the Khurramites, dragged on for far longer, into the 830s.

Historians have interpreted the conflict variously; in the words of the Iranologist Elton L. Daniel, it has been regarded as "a conflict over the succession between a rather incompetent, besotted al-Amin and his shrewdly competent brother al-Ma'mun; as the product of harem intrigues; as an extension of the personal rivalry between the ministers al-Fadl b. Rabi and al-Fadl b. Sahl; or as a struggle between Arabs and Persians for the control of the government".

Background The origins of the civil war lie in the succession arrangements of Harun al-Rashid () as well as the internal political dynamics of the Abbasid Caliphate. The two main contenders, Muhammad al-Amin and Abdallah al-Ma'mun, were born six months apart in AH 170 (786/7) with al-Ma'mun being the elder. It was al-Amin however who was named first heir in 792, while al-Ma'mun followed in 799, a sequence which was influenced by their lines of descent and their political implications: al-Amin had a solidly Abbasid lineage, being Harun's son by Zubayda, herself descended from the second Abbasid Caliph al-Mansur (), while al-Ma'mun's mother was Marajil, a Persian concubine from Badhgis in Khurasan.

While al-Ma'mun's origin was less prestigious than the purely Arab al-Amin, his ties to Khurasan and the Iranian-dominated eastern provinces were an important factor in his choice as heir. In contrast to the exclusively Arab-ruled Umayyad Caliphate, the Abbasid state was under heavy Iranian, and particularly Khurasani, influence. The Abbasid Revolution, which brought the Abbasids to power, originated in Khurasan, and the Abbasid dynasty relied heavily on Khurasanis as military leaders and administrators. Many of the original Khurasani Arab army (Khurasaniyya) that came west with the Abbasids were given estates in Iraq and the new Abbasid capital, Baghdad, and became an elite group known as the abnaʾ al-dawla ("sons of the state/dynasty"). Khurasan retained a privileged position among the Caliphate's provinces, and Harun al-Rashid, in particular, was careful to cultivate his ties with the Iranian element of the Caliphate, not least through his promotion of the Khurasani Barmakid family to positions of power. Both al-Amin and al-Ma'mun had been tutored in their youth by the Barmakids, al-Amin by al-Fadl ibn Yahya and al-Ma'mun by Ja'far ibn Yahya. While al-Amin would distance himself from the Barmakids and become closely associated with the abnaʾ aristocracy of Baghdad, al-Ma'mun remained influenced by Ja'far and his associates.

In 802, Harun and the most powerful officials of the Abbasid government made the pilgrimage to Mecca, where the definitive succession arrangement was drawn up: al-Amin would succeed Harun in Baghdad, but al-Ma'mun would remain al-Amin's heir and would additionally rule over an enlarged and practically independent Khurasan. A third son, al-Qasim (al-Mu'tamin), was also added as third heir and received responsibility over the frontier areas with the Byzantine Empire. The stipulations of the agreement, extensively recorded by the historian al-Tabari, may however have been distorted by later apologists of al-Ma'mun, especially as regards the extent of the autonomy granted to al-Ma'mun's eastern viceroyalty.

Almost immediately after it returned to Baghdad, in January 803, the Abbasid court witnessed the abrupt fall of the Barmakid family from power. On the one hand, this decision may reflect the fact that the Barmakids may have become indeed too powerful for the Caliph's liking, but its timing suggests that it was tied to the succession issue as well: with al-Amin siding with the abnaʾ and al-Ma'mun with the Barmakids, and the two camps becoming more estranged every day, if al-Amin was to have a chance to succeed, the power of the Barmakids had to be broken. Indeed, the years after the fall of the Barmakids saw an increasing centralization of the administration and the concomitant rise of the influence of the abnaʾ, many of whom were now dispatched to take up positions as provincial governors and bring these provinces under closer control from Baghdad.

This led to unrest in the provinces, especially Khurasan, where, according to Elton L. Daniel, "Abbasid policies [fluctuated] between two extremes. One governor would attempt to extract as much wealth as he could from the province for the benefit of Iraq, the central government, and, not infrequently, himself. When the people protested loudly enough, such governors would be temporarily replaced by ones who would attend to local interests". The Khurasani elites had a long-standing rivalry with the abnaʾ. Although the latter now resided chiefly in what is now Iraq, they insisted on retaining control of Khurasani affairs and demanded that the province's revenues be sent west to supply their salaries, something strongly resisted by the local Arab and Iranian elites. The resulting tension was eased when al-Fadl ibn Yahya, universally praised as a model governor, was appointed to Khurasan in 793, but was re-fanned in 796, when a member of the abnaʾ, Ali ibn Isa ibn Mahan, was placed in charge of the province. His harsh taxation measures provoked increasing unrest, which expressed itself in Kharijite uprisings and, finally, a rebellion by the governor of Samarkand, Rafi ibn al-Layth. This uprising forced Harun himself, accompanied by al-Ma'mun and the powerful chamberlain (hajib) and chief minister al-Fadl ibn al-Rabi, to travel to the province in 808. Al-Ma'mun was sent ahead with part of the army to Marv, while Harun stayed at Tus, where he died on 24 March 809.

Civil war between al-Amin and al-Ma'mun, 809–813

Upon Harun's death, al-Amin ascended the throne in Baghdad, where his popularity was great, while al-Ma'mun remained at Marv, from where he planned to campaign against the remaining rebels. However, al-Amin recalled the army and treasury from the east, leaving al-Ma'mun with little in the way of military forces. It was in this time that al-Ma'mun came to rely upon his wazir, the former Barmakid protégé al-Fadl ibn Sahl, who began to implement a policy of conciliation and cooperation with the local elites, whose autonomy and privileges were guaranteed. The covenant of 802 however soon began to fall apart over Baghdad's centralizing ambitions and the dispute over the status of Khurasan: the abnaʾ, led by Ali ibn Isa, whom Harun had imprisoned but who was now set free and appointed head of the Caliph's bodyguard, were joined by other influential officials, chief amongst them al-Fadl ibn al-Rabi, in demanding that Khurasan and its revenue return to the direct control of the central government, even if that meant breaking the stipulations of the Mecca agreement.

Some modern scholars have tried to interpret the conflict between the two brothers as a confrontation between the Arab and Iranian elements of the caliphate, represented by the two contenders' mothers. It is true that the Iranian-dominated East generally backed al-Ma'mun, but neither was al-Amin a conscious champion of "Arabism", nor was the support for al-Ma'mun the result of his Iranian origin, although his supporters did make propaganda among the local population for the "son of their sister". Al-Ma'mun enjoyed the support of the local elites of Khurasan mainly because they saw in him a champion of their newly won autonomy, and because he himself assiduously cultivated that support. Later, during the war, the prospect of his victory also offered the Khurasanis the promise of a yet more privileged position in the new regime. However, the conflict was first and foremost a dynastic dispute, with al-Amin attempting to institute a direct patrilineal succession. In this he did nothing but follow the footsteps of his predecessors since al-Mansur, all of whom struggled against the claims of brothers or cousins. Harun al-Rashid himself was imprisoned during the brief reign of his elder brother al-Hadi (). Given to indolence and lacking any political ability himself, al-Amin entrusted this project to al-Fadl ibn al-Rabi, who is generally portrayed as the "evil genius" behind al-Amin, and one of the main instigators of the conflict. Very quickly, al-Amin moved to sideline the youngest brother, Qasim. Initially, Qasim was removed from his governorship of the Jazira, but soon after he was stripped altogether of his place in the succession and placed under guard at Baghdad. It was only because al-Ma'mun resided far from the Caliph's immediate area of control that he escaped sharing this fate.

The rift between the two camps manifested in 810, when al-Amin added his own son, Musa, to the line of succession. Al-Amin then sent a delegation to Marv, asking al-Ma'mun to return to Baghdad. After al-Ma'mun, fearing for his safety, refused, al-Amin began to interfere with his brother's domain: he protested al-Ma'mun's pardon to Ibn al-Layth after his surrender and asked for tribute from the governors of the western provinces of Khurasan as a sign of submission. He then demanded of his brother the cession of the western regions of Khurasan, the admission of caliphal tax and postal agents into the province, and the forwarding of Khurasan's revenue to Baghdad. Al-Ma'mun, who could not rely on large military forces and whose position was consequently weak, was at first inclined to accede to his brother's demands, but al-Fadl ibn Sahl dissuaded him from this course and encouraged him to seek support among the native population of Khurasan, who also opposed control by the caliphal court.