The Kaaba has been repaired and reconstructed many times since Muhammad's day. The structure was severely damaged by fire on 3 Rabi I (Sunday, 31 October 683), during the first siege of Mecca in the war between the Umayyads and Abd-Allah ibn al-Zubayr, an early Muslim who ruled Mecca for many years between the death of ʿAli and the consolidation of Umayyad power. Ibn al-Zubayr rebuilt it to include the hatīm.[57] He did so on the basis of a tradition (found in several hadith collections[58]) that the hatīm was a remnant of the foundations of the Abrahamic Kaaba, and that Muhammad himself had wished to rebuild so as to include it.
The Kaaba was bombarded with stones in the second siege of Mecca in 692, in which the Umayyad army was led by al-Hajjaj ibn Yusuf. The fall of the city and the death of Ibn al-Zubayr allowed the Umayyads under ʿAbdu l-Malik ibn Marwan to finally reunite all the Islamic possessions and end the long civil war. In 693 AD, ʿAbdu l-Malik had the remnants of al-Zubayr's Kaaba razed, and rebuilt on the foundations set by the Quraysh.[59] The Kaaba returned to the cube shape it had taken during Muhammad's time.
During the Hajj of 930 AD, the Qarmatians attacked Mecca, defiled the Zamzam Well with the bodies of pilgrims and stole the Black Stone, taking it to the oasis region of Eastern Arabia known as al-Aḥsāʾ, where it remained until the Abbasids ransomed it in 952 AD. The basic shape and structure of the Kaaba have not changed since then.[60]
After heavy rains and flooding in 1629, the walls of the Kaaba collapsed and the Masjid was damaged. The same year, during the reign of Murad IV, the Kaaba was rebuilt with granite stones from Mecca and the Masjid was renovated.[61] The Kaaba's appearance has not changed since then.