The city of Mecca was a sanctuary for Abd Allah ibn al-Zubayr, who was among the most prominent challengers to the dynastic succession to the Caliphate by the Umayyad Yazid I.
Although Mu'awiya had named his son, Yazid I, as his heir, this choice was not universally recognized, especially by the old Medinan elites, who challenged the Umayyads' claim to the succession.
The Medinan aristocracy, however, who felt their position threatened by Mu'awiya's large-scale agricultural projects around their city, and regarded Yazid as unfit for the office of caliph due to his reputed dissolute lifestyle, led a public denunciation of their allegiance to Yazid, and expelled the Umayyad family members, some 1,000 in number (including the future caliph Marwan ibn al-Hakam and his sons), from their city.
[9][10][11][12] For his sack of Medina, subsequent tradition remembers Muslim ibn Uqba as, in the words of Julius Wellhausen, the "heathen incarnate", although in the earlier sources he is represented as devout and reluctant to undertake the task assigned to him by the Caliph.
[13] After taking Medina, Muslim set out for Mecca, but on the way he fell ill and died at Mushallal, and command passed to his lieutenant Husayn ibn Numayr al-Sakuni.
In a first battle, Ibn al-Zubayr proved victorious,[17][18] but the Umayyads persisted, and on 24 September placed the city under siege, employing catapults to bombard it with stones.
On Sunday, 31 October, the Kaaba, over which a wooden structure covered with mattresses had been erected to protect it, caught fire and burned down, while the sacred Black Stone burst asunder.
Ibn al-Zubayr refused the last demand, since this would place him under the control of the Syrian elites, and Husayn with his army departed for Syria.
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.
After the Umayyad reconquest of the city, the hatīm was separated again from the main building, and the western gate was walled up, reverting to the general outlines of the pre-Islamic plan.