The defeat of al-Mukhtar, who had opposed the Zubayrids and the Umayyads, left Ibn al-Zubayr and Marwan's son and successor Abd al-Malik (r. 685–705) as the two main contenders for the caliphate. However, Kharijite gains in Arabia had isolated Ibn al-Zubayr in the Hejaz, cutting him off from loyalists in other parts of the caliphate. In 691, Abd al-Malik secured the support of Zufar and the Qays of Jazira, removing the principal obstacle between his Syrian army and Zubayrid Iraq. Later that year, his forces conquered Iraq and killed Mus'ab in the Battle of Maskin. Al-Muhallab, who was leading the fight against the Kharijites in Fars and Ahwaz, subsequently switched his allegiance to Abd al-Malik.