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 pro-Zubayrid 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 pro-Zubayrid forces by the end of July. With Kufa secured, Mukhtar again dispatched Ibn al-Ashtar to confront Ubayd Allah's army.
