The Mosque of al-Aqsa is situated on sacred land in the city of Jerusalem, chosen by God from the beginning of time. It has been rendered as such so that the believers would glorify God. The Mosque of al-Aqsa is the second place of worship that was established on the Earth. Abu Dhar said: I said, “O Messenger of Allah, what is the first Masjid placed on the earth?” He said, “Masjid Haraam (Makkah)”. I then asked, “What is the second Masjid?” He said “Masjid al-Aqsaa”. I asked, “What is the time period between the establishment of these two Mosques?” He said, “Forty years, and wherever you have to pray, perform the prayer, since the Earth has been made a place of prayer.” (Muslim)
When the Prophet Adam built the Ka’bah, God ordered him to go to where the Mosque of al-Aqsa stands today. He ordered him to build the Mosque and to worship God there. This was the very first place of worship to be built in that region.
After the Prophet Adam, the Prophet Solomon restored the Mosque and expanded it. The Prophet Muhammad said: “After Solomon, son of David, finished building Masjid al-Aqsaa, he asked Allah to bestow him a Rule and Kingdom like no one had before, and one which was not befitting to anyone afterward. Also that no one would come to this Masjid seeking to pray in it, except that he would return from it sin-free.” The Prophet said, “As for two (of the three requests) he was granted, and I hope that he will be granted the third.” (Ibn Khuzaimah)
It is the first of the two Qiblahs (direction of prayer) the Prophet faced in his prayers, and the Muslims prayed towards it before they were ordered to pray facing the Ka’bah. During the Night Journey, he stopped at Masjid al-Aqsa, and from there he ascended to the Heavens. He led the prophets in prayer during this night journey. It is the third Haram (sacred sanctuary), after Makkah and Madinah.