He defeated the pro-Zubayrid tribes of Syria at the Battle of Marj Rahit in August 684 and recaptured Egypt from Ibn al-Zubayr's governor shortly afterwards.[10] Ibn al-Zubayr lost much of Iraq to the pro-Alid Mukhtar al-Thaqafi;[11] while the Kharijites, with whom Ibn al-Zubayr had allied during the earlier siege, denounced him after he claimed the Caliphate and started undermining him. Although his brother Mus'ab was able to retake Iraq from Mukhtar, Kharijite insurgents captured large parts of Persia and Arabia.[12] Marwan died in April 685 and his son Abd al-Malik became caliph and embarked on restoring Umayyad power. After quelling internal disturbances, Abd al-Malik invaded Iraq and killed Mus'ab at the Battle of Maskin in October 691.[13] As a result, Ibn al-Zubayr lost control of most of his territory[14] and was confined to the Hejaz.[12] Even there, he lost Medina to Abd al-Malik's mawlā Tariq ibn Amr, who had earlier defeated a 2,000-strong Zubayrid army and taken control of the city.[15]