Due to its theological and religious status, Jerusalem had a very important place in the life of the Prophet Mohammad himself.
In the year 620 almost one-and-a-half years before his Hijra (migration) from Makkah to Madinah the famous event of Isra and Miraj (Night Journey and Ascension) occurred. One night, in a miraculous way, the Prophet was taken on a momentous journey from Makkah to Jerusalem and then from there to the heavenly celestial abodes.
The Night Journey was a great miracle that Muslims believe was given to Prophet Mohammad as an honor and as a confirmation of Makkah's spiritual link with Jerusalem.
Both of these events took place on the same night. The angel Gabriel took the Prophet from Makkah to Jerusalem. There it is reported that the Prophet stood at the Sacred Rock (al-Sakhrah al-Musharrafah), went to the heavens, returned to Jerusalem and met with many Prophets and Messengers who were gathered together for him on that occasion and he led them in prayers.
After these experiences the Prophet was taken back to Makkah. The story of Isra and Miraj is full of wonderful signs and symbols. Muslim thinkers, mystics and poets have interpreted it in deep an meaningful ways. There is, however, one essential point and that is it serves as an example of every Muslim"s deep devotion and spiritual connection with Jerusalem.
During the Miraj, the Prophet is reported to have received from Allah the command of five daily prayers (Salah) that all Muslims must perform. Upon his return to Makkah, the Prophet instituted these prayers. It is significant to note that he made Jerusalem the direction (al-Qiblah) which Muslims must face while doing their prayers. Jerusalem is thus called Ula al-Qiblatain (the First Qiblah).
The Prophet and the early community of Islam worshipped towards the direction of Jerusalem during their stay in Makkah. After the Hijra (migration), Muslims in Madinah also continued to pray facing Jerusalem for almost seventeen months. Then came Allah's command to change the direction of prayer from Jerusalem to Makkah (2:142 - 150).
Muslim commentators of the Quran and historians have explained the meaning and purpose of this change.
It is a lengthy subject that we cannot discuss in detail here. Suffice it to say that the change of the Qiblah in no way diminished the status of Jerusalem in Islam.
The Kaba in Makkah was meant to be the Qiblah from the beginning, because the Quran said that it was the First House (Awwal Bait 3:96) established for mankind to worship the One God.
The Kaba, however, was full of idols when the Prophet Mohammad began preaching his message to Tawhid (the Oneness and Transcendence of Allah).
A separation had to be made between the people and the pagan worship that they used to perform at the Kaba. Jerusalem served that purpose very well by distancing the people from their pagan and idolatrous associations.
Once monotheism was fully established in the minds and hearts of the believers and once the Kaba"s position with Abraham and with monotheism was made clear, the way was open to restore the Kaba as the direction of prayers.
There are many instances of this type of change or abrogation ("naskh") in Islamic legislation. As one example, visiting graves was forbidden in the beginning of Mohammad (peace and blessings be upon him) messenger ship.
Later it was permitted because Muslims had learned the difference between a grave visit and ancestor worship. At first, the Prophet forbade his people to write down his words except when he told them that what he was saying was revelation - the Quran, the Word of Allah.
Later when people learned the difference between the Quran and Hadith (sayings and deeds of the Prophet), he gave them permission to write Hadith as well.
It is interesting to note that the Kaba in Makkah was the original direction of prayers for all the Prophets of Allah.
According to a Hadith, the Black Stone (al-Hajar al-Aswad) had been in Makkah at the place of Kaba since the time of Adam. It was the Prophets Abraham and Ishmael who built the Kaba under Allah's command and direction (2:125 - 127).
The city of Jerusalem was established as a religious center for the Israelite people by the Prophets David and Solomon around the year 900 BC.
This was almost 1,000 years after the time of Prophet Abraham and the building of the Kaba. Thus one can say that the Kaba had a historical primacy over Jerusalem.
Furthermore, it is important to note that the Bible says that the early Israelites in Jerusalem used to turn to the southern direction when making their most sacred prayers and offerings (Exodus 27:9; 40:24). The Kaba is in the southern direction of Jerusalem. Thus we can say that the Kaba was also a Qiblah for the earlier Israelite communities as well.