The Iraq theater was one of two major areas of operations during the Zanj Rebellion, the other being the neighboring province of al-Ahwaz.

The revolt, which began in September 869 in southern Iraq, was initially limited to the region around the port city of Basra, as well as the southern districts of al-Ahwaz to the east. Efforts by the Abbasid caliphs in Samarra to crush the rebellion proved ineffectual, and several towns and villages were occupied or sacked. Basra itself fell in September 871 following an extended blockade, after which the city was burned and its inhabitants massacred. A retaliatory campaign undertaken by the caliphal regent Abu Ahmad ibn al-Mutawakkil (known by his honorific of al-Muwaffaq) against the rebels in 872 ended in failure, and the Zanj remained on the offensive over the next several years.

The continuing inability of the Abbasid central government to suppress the revolt, caused in part by its preoccupation with fighting against the Saffarid Ya'qub ibn al-Layth's advance into Iraq, eventually encouraged the Zanj to expand their activities to the north. A campaign by the rebels to occupy the marshlands between Basra and Wasit in 876 proved successful, and soon they made their way into the district of Kaskar. By 879, the rebellion reached its furthest extent; Wasit was sacked and the rebels advanced northwest along the Tigris, coming to within fifty miles of Baghdad.

The Abbasid government finally regained the initiative in the war in late 879, when al-Muwaffaq sent his son Abu al-'Abbas (the future caliph al-Mu'tadid) with a major force against the rebels. Al-Muwaffaq himself joined the offensive in the following year, and over the next several months the government forces succeeded in driving the rebels back toward their "capital" of al-Mukhtarah, to the south of Basra. Al-Mukhtarah itself was put under siege in February 881, and its fall in August 883, combined with the death or capture of most of the rebel commanders, brought the revolt to an end.

In the opening stages of the war, the Zanj were personally led by the revolt's leader 'Ali ibn Muhammad. Following the construction of al-Mukhtarah, however, 'Ali seldom went into the field himself, and the rebels armies in Iraq came to be led by several of his deputies, such as Yahya ibn Muhammad al-Bahrani and then, after the latter's capture and execution in 872, Sulayman ibn Jami', Ahmad ibn Mahdi al-Jubba'i, and Sulayman ibn Musa al-Sha'rani. The Abbasid government, for its part, rotated a number of officers to prosecute the war against the Zanj, but few of these made significant progress in quelling the rebellion prior to 879.

The Zanj armies, bolstered by allied Arab tribesmen, included a mix of both infantry and cavalry troops, and were able to repeatedly score victories against the government forces in both pitched battles and ambushes. Both sides were also heavily reliant on watercraft to navigate the extensive canal system of lower Iraq and the waterways of the marshlands, and barges were frequently used to transport both men and supplies. The rebels also undertook other activities in the districts under their control, such as constructing fortresses, securing agreements with neighboring villages, collecting taxes and supplies, digging canals, and minting their own coins.

Background

The leader of the rebellion was one 'Ali ibn Muhammad, a man of obscure background. Prior to the outbreak of the revolt, 'Ali had traveled to the province of al-Bahrayn in eastern Arabia 863, where he gained a number of followers, including Yahya ibn Muhammad al-Bahrani and Sulayman ibn Jami', and attempted to form an imamate in opposition to the Abbasids. This scheme, however, floundered due to opposition from the local inhabitants, and in 868 he decided to depart for the port city of Basra in southern Iraq.; ;

At Basra 'Ali again proclaimed a new revolt, but this also failed when the populace refused to support him. He was forced to flee Basra for the nearby marshlands, where he was arrested and transported to the city of Wasit. After a short time, however, 'Ali was able to convince the local governor to release him and his companions, and he afterwards made his way to Baghdad. There he remained for the next year, during which time he gained additional followers for his cause.; ;

In 869 'Ali learned that his family, who had previously been incarcerated in Basra, had been released. He therefore decided to return to the Basra region, arriving there with his followers in August/September of that year. Upon his arrival he began to induce the local slave laborers, including Zanj slaves trafficked from eastern Africa to slavery in the Abbasid Caliphate, to join him, and adopted a heterodox slogan to give religious justification for a revolt.; ;

869

Initial operations

In early September 869, 'Ali and his followers began seizing slaves in the Basra region and encouraged them with promises of plunder if they sided with his rebellion. After several hundred slaves joined him in this manner, he crossed the Dujayl and set up a camp, where he continued to recruit more followers. A few days later, the rebels defeated a detachment just after Eid al-Fitr, thus winning their first victory.; ;

The local authorities and magnates quickly scrambled to suppress the revolt, and a force of four thousand men was sent to attack the Zanj. Despite being poorly equipped for combat, the rebels defeated this army and took a number of prisoners, who 'Ali ordered to be beheaded. 'Ali then made his way to several villages in the region, where the inhabitants either submitted to him or fled, and at the same time gained his first booty. Following several further defeats in battle, the locals attempted to buy 'Ali off if he agreed to return the slaves to their owners, but this was indignantly rejected by the rebel leader and fighting between the two sides went on.; ;

Over the course of the next several weeks, the rebels continued to grow in strength. The efforts of the Basran authorities and landowners to put down the revolt proved ineffective, and several detachments sent against the rebels were defeated. With no force capable of stopping them, the Zanj continued to pillage their way through the region, and a number of villages either voluntarily submitted or were sacked.; ;

Battle of the Barges

By mid-October the Zanj had grown strong enough to attempt an advance on Basra. As the rebels approached the city, however, they were met by a large group of Basrans and suffered a serious defeat. Encouraged by their success, the Basrans organized a fresh expedition to fight the rebels, who had retreated to a camp on the Nahr Shaytan. The force consisted of a number of barges and galleys, and was escorted on land by a large crowd, which included a number of unarmed civilians.; ;

Upon learning of the Basran advance, 'Ali ibn Muhammad set up an ambush, placing detachments on both banks of the canals. When the Basran force arrived they were suddenly attacked by the Zanj on all sides and were soon overwhelmed. The battle continued until almost the entire Basran force was annihilated; only a few managed to escape the rout.; ;

The Zanj victory on the Nahr Shaytan, known as the Day of the Barges, was a watershed moment in the war, and transformed what had previously been a largely local affair into one requiring the intervention of the central government. In the aftermath of the battle, the residents of Basra became convinced that the rebels had become too strong to be defeated by local forces and abstained from engaging in further fighting. At the same time, the Abbasid government in Samarra realized that it would have to become more involved in suppressing the revolt, and decided to dispatch additional government troops to the region.; ;

869-870

Arrival of Ju'lan al-Turki, construction of al-Mukhtarah

Following the Zanj victory over the Basrans, the Abbasid government sent a force under the command of Ju'lan al-Turki to southern Iraq to fight against 'Ali ibn Muhammad.; ; Ju'lan spent the next six months in the field, but he soon found that his mounted troops could not easily move through the dense landscape, and he was unable to make any headway against the Zanj. After the rebels undertook a devastating night-time raid against his camp, he decided to abandon the campaign and return to Basra. Ju'lan's withdrawal convinced the government that he was unsuitable for the task of defeating the rebels; he was therefore dismissed and his command was given to Sa'id ibn Salih al-Hajib instead.; ;

Around the same time, 'Ali ibn Muhammad made his way to the western side of the Nahr Abi al-Khasib and began construction on a settlement there.; ; Known as al-Mukhtarah, it became the "headquarters" of the Zanj for the duration of the revolt, serving as the primary residence of the Zanj leader and as a place of refuge for the rebels. From this point forward, 'Ali ibn Muhammad largely refrained from personally leading the Zanj into battle, and instead remained in al-Mukhtarah and delegated the command of his forces to his lieutenants.

Occupation of al-Ubulla

Julan's withdrawal to Basra and the weakness of the government forces allowed the Zanj to continue their raiding activities in lower Iraq unimpeded.; ; Soon after Ju'lan left the field, 'Ali ibn Muhammad decided to undertake an expedition against one of the cities of the region. He initially intended to send his troops against 'Abbadan; after his army began their march, however, he was advised that al-Ubulla would be a better target. As a result, he recalled his men and ordered them to head toward that city instead.;

Upon arriving at al-Ubulla, the Zanj found the city to be defended by Abu al-Ahwas al-Bahili, whom Ju'lan had appointed as its governor.Al-Tabari, p. 67; Ibn al-Athir, p. 212 Nevertheless, the rebels initiated their assault, attacking the city both on land and from commandeered boats. Fighting between the Zanj and defenders continued until the evening of June 28, 870, at which point the Zanj stormed the city from the direction of the Tigris and the Nahr al-Ubulla. The defenders were soon overwhelmed, and both the governor and his son were killed during the fighting.; ;

As the Zanj spread throughout the city, they put it to the torch. Many buildings in al-Ubulla were made of teakwood and were constructed close together; as a result, the fire soon spread throughout the city, destroying much of it. Many residents were killed; others attempted to flee into the waterways and drowned. The Zanj then began to plunder al-Ubulla and collected large number of spoils, but by that point most of the city's goods had been destroyed by the flames.

News of the sack of al-Ubulla spread terror throughout the region. The residents of 'Abbadan, fearing that they would suffer a similar fate, decided to surrender to the Zanj. 'Ali ibn Muhammad sent troops to the city, where they were allowed to seize any weapons and slaves that they could find.; ; The people of Basra were also panicked by the news; the fall of al-Ubulla, together with that of al-Ahwaz later that year, caused many to flee the city, moving to safer areas not subject to Zanj attack.; ;

870-871

Campaign of Sa'id ibn Salih

In mid-871, the Abbasid government desired to initiate a new offensive against the Zanj, and sent Bughraj to press Sa'id ibn Salih on the matter. Sa'id accordingly set out for the Tigris in June and advanced toward the headquarters of 'Ali ibn Muhammad, eventually reaching the Nahr Ma'qil. There he encountered a rebel army on a tributary canal, and despite being wounded he succeeded in routing the Zanj. The victorious government troops gained loot and freed a number of women who had been taken captive by the rebels.; ;