All perfect praise be to Allah, the Lord of the worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and Messenger.
Allah’s support for the believers is contingent upon the believers’ support for Allah’s religion and their submission to His will. The protection of the Quran is also contingent upon specific conditions; however, these conditions are determined by Allah to materialize so that nothing will prevent them from happening.
As for the Kaaba, Abu Hurayrah narrated that the Prophet, sallallaahu ‘alayhi wa sallam, said: “The Kaaba will be destroyed by Dhul-Suwayqatayn from Abyssinia.” [Al-Bukhari and Muslim]
Historically speaking, ‘Abdullah ibn Az-Zubayr was reported to have demolished the Kaaba and then rebuilt it on the original foundations that Prophet Ibraheem (Abraham) established. Then, the Kaaba was again demolished by Al-Hajjaj, who rebuilt it back to the same condition that it was in in pre-Islamic Period of Ignorance.
Ibn Hajar comments:
It was said that this Hadeeth contradicts Allah’s Saying: {Have they not seen that We made [Makkah] a safe sanctuary?} [Quran 29: 67]
Allah prevented the Elephant and the Abyssinian army from damaging the Kaaba despite the fact that Islam had not been established by then. One might object how it could be that Allah guarded the Kaaba against the Abyssinians in the past before Islam and then will give them control over it in the future, after Islam has been established. One response to this objection is that the destruction of the Kaaba will take place at the end of the world, shortly before the Day of Judgment and at a time when no believer will exist on earth. In this regard, the Prophet, sallallaahu ‘alayhi wa sallam, said, “The Day of Judgment will not take place until there will be no believer to witness that there is no god worthy of worship but Allah.” [Muslim]
This last interpretation is substantiated by the Prophet’s statement that was narrated by Sa‘eed ibn Sam‘an and in which the Prophet, sallallaahu ‘alayhi wa sallam, stated that the Kaaba will never be built again after it will be destroyed at the end of the world.
Historically speaking, the Syrians invaded the Kaaba during the time of Yazeed ibn Mu‘awiyah. From then on, the Kaaba has witnessed separate attacks, the greatest of which came from the Qarmatians after three hundred years of Islam had passed. During their attacks, the Qarmatians slaughtered many, many pilgrims, stole the Black Stone, and took it to their territory as they seized it for many years before they eventually returned it to Makkah. Later attacks followed on the Kaaba. Yet all these events do not contradict Allah’s saying: {Have they not seen that We made [Makkah] a safe sanctuary?} [Quran 29: 67] This is because all these events mainly came from Muslims, which goes in line with the Prophet’s statement, “No violation comes to this House except through its own people.” This is what the Prophet, sallallaahu ‘alayhi wa sallam, foretold; the Prophet’s foreknowledge bears a testament to His prophecy. Finally, the verse in hand does not indicate that the state of peace and security at the Kaaba is sustainable.
Allah knows best.