The
Umayyad Caliphate was shaken by the deaths of Caliph
Yazid I and his successor
Mu'awiya II in 683 and 684, respectively, amid the
Second Muslim Civil War. In the aftermath, they lost authority over
Iraq (the part of
Mesopotamia south of
Tikrit) while the governors of northern
Syria and
Palestine switched their allegiance to
Abd Allah ibn al-Zubayr, the anti-Umayyad claimant to the
caliphate. These and other defections restricted Umayyad rule to the region of
Damascus. After the Umayyad governor of Iraq,
Ubayd Allah ibn Ziyad, was forced out of his province, he left for Damascus to prop up Umayyad rule. As a result of his efforts and the consensus of loyalist
Arab tribes, later collectively known as the "Yaman", the Umayyad elder,
Marwan ibn al-Hakam, became caliph in June 684. In August 684, the Umayyads and their tribal allies routed the Zubayrid loyalist
Qaysi tribes at the
Battle of Marj Rahit. The Umayyad victory brought all of Syria under Marwan's authority, but also led to the long-running
feud between Qays and Yaman. Later, Marwan dispatched an army led by Ubayd Allah to wrest back Iraq. Control of that region was split by a number of anti-Umayyad factions, including the partisans of
Mukhtar al-Thaqafi, other
Pro-Alids (supporters of Caliph
Ali and his family) and Ibn al-Zubayr. Marwan promised Ubayd Allah the governorship of all the territories that he conquered. In early January 685, Ubayd Allah was mobilizing his troops at the
Euphrates River town of
Jisr Manbij. Around that time, his second-in-command,
Husayn ibn Numayr al-Sakuni, destroyed the Penitents, a
Pro-Alid band led by
Sulayman ibn Surad, at the
Battle of Ayn al-Warda in modern-day
Ras al-Ayn. Marwan died in the spring of 685, while Ubayd Allah's army was camped at
Raqqa, and Marwan's son
Abd al-Malik succeeded him as caliph. In the eighteen months following the Umayyad victory at Ayn al-Warda, Ubayd Allah's troops were bogged down by struggles with the Qaysi tribes of the
Jazira (Upper Mesopotamia) led by the Zubayrid loyalist
Zufar ibn al-Harith al-Kilabi. In the summer of 686, Ubayd Allah's troops advanced toward
Mosul, long controlled by a
Kufan military elite, with the ultimate aim of conquering Iraq. Mukhtar, who in the weeks prior had seized Kufa from Ibn al-Zubayr's governor, rapidly organized and dispatched a force under his commander,
Ibrahim ibn al-Ashtar, to confront the Umayyad army. Ubayd Allah defeated this force on 9–10 July 686. Meanwhile,
Mus'ab ibn al-Zubayr and the
ashraf (Arab tribal nobility) of Kufa used the absence of Mukhtar's forces as an opportunity to recapture Kufa. The attempt failed as Mukhtar was able to recall his troops and defeat the Zubayrid forces by the end of July. With Kufa secured, Mukhtar again dispatched Ibn al-Ashtar to confront Ubayd Allah's army. ==Combatants==