In the early years of Islam, Muslims faced the direction of Jerusalem as the qibla (holy prayer direction) for their prayers before changing the direction to face the Kaaba, as a result of a revelation to Prophet Muhammad. According to Islam, the Kaaba was destroyed and rebuilt several times throughout its history, most famously by Prophet Ibrahim (Abraham) and his son Prophet Ismail (Ishmael).
Karen Armstrong asserts that the Kaaba was officially dedicated to Hubal, a Nabatean deity, and contained 360 idols which probably represented the days of the year. Armstrong also says that the Kaaba was thought to be at the center of the world, with the Gate of Heaven directly above it. The Kaaba marked the location where the sacred world intersected with the profane world; the embedded Black Stone meteorite was a further symbol of for it fell from the sky and thus linked heaven and earth.
The Qur’an contains 3 verses regarding the origin of the Kaaba stating that the Kaaba was the first (monotheistic) House of Worship for mankind, and that it was rebuilt by Prophets Ibrahim and Ismail on Allah’s instructions.
1 “Verily, the first House (of worship) appointed for mankind was that at Bakkah (Makkah), full of blessing, and a guidance for mankind. (Quran 3:96)
2 “Behold! We gave the site to Ibrahim of the (Sacred) House, (saying): “Associate not anything (in worship) with Me; and sanctify My House for those who compass it around, or stand up, or bow down or prostrate themselves (in prayer).” (Quran 22:26)
3 “And remember (Prophets) Ibrahim and Ismail raised the foundations of the House (praying): “Our Lord! Accept (this structure) from us: for You are All-Hearing and All-knowing.” (Quran 2:127)
Ibn Kathir, in his famous exegesis (tafsir) of the Quran, mentions two interpretations among the Muslims on the origin of the Kaaba. One is that the temple was a place of worship for angels before the creation of humans. Later, a house of worship was built on the location but it was destroyed by Noah’s flood, and was finally rebuilt by Prophets Ibrahim and Ismail as mentioned later in the Quran.
Ibn Kathir regarded this tradition as weak and preferred instead the narration by Ali ibn Abi Talib that although several other temples might have preceded the Kaaba, it was the first Bayt Allah (“House of God”), dedicated solely to monotheism, built with God’s instruction, and sanctified and blessed by Him, as stated in Quran 22:26”
There is also a hadith in Sahih al-Bukhari stating that the Kaaba was the first (monotheistic) mosque on Planet Earth, and the second was Prophet Solomon’s Temple in Jerusalem.
Although the Hebrew Bible is filled with geographic details, it is vague about the places where Prophet Abraham was twice tested by God’s demand that he should make his sons into ritual offerings. All we know is that the place was on a hilltop later called Zion.
During the almost 950 years that the First and Second Jerusalem Temple stood they welcomed Jews and monotheistic non-Jews (Hanifs), to attend services daily; for as Prophet Solomon himself said in his dedication service: “As for the foreigner who does not belong to your people Israel, but has come from a distant land because of your name— for they will hear of your great name and your mighty hand and your outstretched arm—when they come and pray toward this Temple, then hear from heaven your dwelling place.
“Do whatever the foreigner asks of you, so that all the peoples of the earth may know your name and be in awe of you, as do your own people Israel, and may know that this house I (Solomon) have built bears your Name.” (1 Kings 8:41-43)
Although Islam is a universal religion, non-Muslims are prohibited from entering the Kaaba or even the city of Makka where the Kaaba was built. And since Judaism has a pluralistic, ‘many religions are true’ philosophy, the Jerusalem Temple always had a section available for non-Jewish foreigners.
Thus, “Each (religious) community has its own direction to which it turns (in prayer), compete then with one another in doing good deeds. Wherever you may be God will bring all of you before Him (on Judgement Day). God has power over all things.” (Qur’an 2:148)