المختار الثقفي
The retreat of the Umayyad army left Ibn al-Zubayr in undisputed control of Mecca. With the collapse of Umayyad authority, he was soon acknowledged as the rightful caliph across most of the Muslim world, including northern Syria. His authority, however, remained mostly nominal. The Umayyads, under the leadership of Marwan ibn al-Hakam, managed to consolidate their position in Syria in the Battle of Marj Rahit, and even reclaimed Egypt, but an Umayyad attempt to recover control of Iraq was defeated by pro-Alid forces under Mukhtar al-Thaqafi near Mosul in August 686. Abd al-Malik, who had succeeded his father Marwan after the latter's death in April 685, thereafter restricted himself to securing his own position, while Ibn al-Zubayr's brother Mus'ab defeated Mukhtar at the Battle of Harura and gained control of all of Iraq in 687. In 691, Abd al-Malik managed to bring Zufar al-Kilabi's Qays back into the Umayyad fold, and advanced into the Iraq. Mus'ab was defeated and killed, and Umayyad authority re-established across the East. After another siege of Mecca which lasted from March–October 692, Ibn al-Zubayr was killed, and the civil war ended.