The Battle of Ayn al-Warda (Arabic language:معركة عين الوردة) was fought in early January 685 between the Umayyad army and the Penitents (Tawwabun).[lower-alpha 1] The Penitents were a group of pro-Alid[lower-alpha 2] Kufans led by Sulayman ibn Surad, a companion of Muhammad, who wished to atone for their failure to assist Husayn ibn Ali in his abortive uprising against the Umayyads in 680. Pro-Alid Kufans had urged Husayn to revolt against the Umayyad caliph Yazid but then failed to assist him when he was killed in the Battle of Karbala in 680. Initially a small underground movement, the Penitents received widespread support in Iraq after the death of Yazid in 683. They were deserted by most of their supporters shortly before the departure to northern Syria where a large Umayyad army under the command of Ubayd Allah ibn Ziyad was preparing to launch an assault on Iraq. In the three-day long battle that ensued at Ras al-'Ayn, the small Penitent army was annihilated and its senior leaders, including Ibn Surad, were killed. Nevertheless, this battle proved to be a forerunner and source of motivation for the later more successful movement of Mukhtar al-Thaqafi.
The first Umayyad caliph Muawiyah's designation of his son Yazid as heir in 676 had been opposed by many who resented his rise to the caliphate. Hereditary succession was alien to Arab custom, where the rulership passed within the wider clan, and Islamic principles, where the supreme authority over the Muslim community was not the possession of any man. Opposition was led especially by the sons of a few prominent companions of Muhammad, who, according to Islamicist G. R. Hawting, could lay "some claim to be considered as caliphal candidates" by virtue of their descent. They refused to be bribed or cajoled into acknowledging Yazid. After Muawiyah's death in April 680, Yazid ordered the governor of Medina, where all his opponents were based, to obtain their obedience. Of these, Husayn ibn Ali and Abd Allah ibn al-Zubayr evaded the governor and escaped to Mecca. There Husayn received letters from the Iraqi garrison town of Kufa with the invitation to revolt against Yazid and regain his rightful place as the leader of the Muslim community which his father, Ali (r. 656–661), had previously held. Husayn sent his cousin Muslim ibn Aqil to prepare the ground for his arrival. Ibn Aqil sent back a favorable report, urging Husayn to depart for Kufa. Shortly afterwards, Ibn Aqil was apprehended and executed by the Umayyad governor Ubayd Allah ibn Ziyad and his supporters suppressed. Unaware of the situation, Husayn left for Kufa, but was intercepted and killed just outside of the town. His expected support never arrived.
Some of Husayn's supporters in Kufa, who called themselves Penitents, blamed themselves for the disaster and decided to atone for their perceived sinful abandonment of their leader. Considering the prohibition of suicide in Islam, they decided to sacrifice themselves in a fight against the perpetrators of the massacre, to achieve salvation and martyrdom. Sulayman ibn Surad, a companion of Muhammad and old ally of Ali, was chosen as leader of the movement. Meanwhile Yazid died in 683 and Umayyad authority collapsed across the Caliphate, giving rise to the civil war known as the Second Fitna. Ibn Ziyad was expelled from Iraq and he fled to Syria. This afforded the Penitents their opportunity to act. A large-scale recruiting campaign was launched which met with considerable success and 16,000 men joined the movement. On the day of departure though, only 4,000 men arrived, of whom another 1,000 left on the way. Undeterred, the Penitents moved up the Euphrates river towards the Jazira (Upper Mesopotamia). They were all mounted and well equipped.
The short reign of Yazid's successor Muawiyah II ended with his death after a few weeks. With no suitable Sufyanid[lower-alpha 3] candidate to succeed him, Umayyad loyalists in Syria chose Marwan ibn al-Hakam, a cousin of Muawiyah I, as the caliph. Marwan's accession was challenged by several north-Syrian tribes led by Banu Qays who supported the cause of the Mecca-based counter-caliph Abd Allah ibn al-Zubayr. Marwan defeated them with a small army of 6,000 at the Battle of Marj Rahit (684). Following the victory, he sent Ibn Ziyad back to Iraq. Realizing that his forces were not strong enough to reconquer the province, Ibn Ziyad set out to strengthen Umayyad army by recruiting from various Syrian Arab tribes, which included even the tribes that had opposed Marwan at the Battle of Marj Rahit. By the time he faced the Penitents, Ibn Ziyad had raised a formidable army of Syrians.
On their march towards Syria, the Penitents made a short stay at al-Qarqisiya. The Qaysi refugees from the Battle of Marj Rahit of the previous year had entrenched themselves there and aided the Penitents with supplies. The Qaysi chief Zufar ibn al-Harith al-Kilabi informed Ibn Surad of the Umayyad troops' location and advised him to march on Ayn al-Warda (identified with modern Ras al-Ayn) and arrive there before the Umayyads, as the town could be used as a base of operations in the arid steppes. Given the large numerical disparity, Zufar urged him to avoid a pitched battle and instead divide his cavalry into small detachments and conduct constant skirmishes against their flanks, "firing arrows at them and thrusting at them in an open space for they outnumber you and you cannot be sure that you will not be surrounded". Noticing the absence of infantry in the Penitents' force, Zufar also advised to pair the detachments so that one could fight mounted and the other fighting on foot when needed. Despite showing sympathy, Zufar refrained from joining the Penitents outright, seeing no hope in their endeavor. Nevertheless he offered Ibn Surad to stay in al-Qarqisiya and fight the Umayyads alongside him, but Ibn Surad refused.
Following Zufar's advice, the Penitents camped outside Ayn al-Warda, with the town in their rear. They rested for five days before the Umayyad army arrived. The total strength of the latter was 20,000, but it was divided into two units, due to disputes between its two field commanders. Some 8,000 troops were under the command of Shurahbil ibn Dhi'l-Kala, and the rest were under Husayn ibn Numayr. Shurahbil arrived first, ahead of Ibn Numayr, and made camp. The Penitents attacked him and his troops fled. The next day, Ibn Numayr arrived with his troops. He called on the Penitents to surrender, who in turn demanded the surrender of the Umayyad army and the handing over of Ibn Ziyad, the supreme commander of the Umayyad forces, to be executed for his involvement in the death of Husayn. The battle began on Wednesday, 4 January.[lower-alpha 4] Ibn Surad divided the Penitents into three groups, sending two to attack the Umayyad flanks, while he himself remained in the center. On the first day, the Penitents were able to repel the Umayyads, but on the next day, Ibn Ziyad sent Shurahbil back to fight under the command of Ibn Numayr, and the numerical superiority of the Umayyad army began to prevail. Despite holding the ground, the Penitents suffered severe losses. On the third day of the battle, they were completely surrounded. Ibn Surad ordered his men to dismount and advance on foot to engage in one-on-one combat. The Umayyad army started raining arrows on them and the Penitents were almost annihilated. Ibn Surad fell to an arrow shot, and of the remaining four commanders, three were killed in quick succession. Finally, the Penitents' banner passed to the last commander, Rifa ibn Shaddad. At this point, the Penitents received the news that their supporters from al-Mada'in and Basra were on the way to join them, but they had been completely destroyed by now, so instead of waiting for the reinforcements, Rifa retreated with a few survivors and escaped to al-Qarqisiya during the night.
The small number of Penitents who survived felt remorse for not having fulfilled their vows of sacrifice. They went over to join another pro-Alid leader, Mukhtar al-Thaqafi, who had earlier been prevented by the Umayyad governor from assisting Husayn in the Battle of Karbala. Mukhtar had been critical of the Penitents movement for its lack of organization and political program. With Ibn Surad gone, Mukhtar became the undisputed leader of the pro-Alid Kufans. He had long-term plans and a more organized movement; he appropriated the Penitents' slogan of "Revenge for Husayn", but also advocated for the establishment of an Alid caliphate in the name of Ali's son Muhammad ibn al-Hanafiyyah. In contrast to the Penitents, which had been a purely Arab movement, Mukhtar also appealed to local non-Arab converts (mawālī). In addition, he was able to win over an influential military commander and the chief of the Nakha tribe, Ibrahim ibn al-Ashtar. With his combined forces, he seized Kufa, and consequently its eastern and northern dependencies, in October 685. Later he sent a considerably large and professional army of 13,000, which consisted mostly of infantry, under Ibn al-Ashtar, to fight the Umayyads. Ibn al-Ashtar destroyed the Umayyad army at the Battle of Khazir and killed Ibn Ziyad, Ibn Numayr and Shurahbil. Mukhtar controlled most of Iraq, parts of the Jazira, Arminiya and parts of western and northern Iran (Adharbayjan and Jibal), before he was killed by the Zubayrid governor of Basra Mus'ab ibn al-Zubayr in April 687.