The entire Muslim claim to Jerusalem comes from this story, of which the Koran only elliptically alludes to, in verses 1 and 60 of chapter 17:
1. Glory to (Allah) Who did take His servant for a Journey by night from the Sacred Mosque to the farthest Mosque, whose precincts We did bless,- in order that We might show him some of Our Signs: for He is the One Who heareth and seeth (all things).The idea that the "farthest mosque" is Jerusalem is far from universal, even among Muslims.
60. Behold! We told thee that thy Lord doth encompass mankind round about: We granted the vision which We showed thee, but as a trial for men,- as also the Cursed Tree (mentioned) in the Qur'an: We put terror (and warning) into them, but it only increases their inordinate transgression!
In this translation, the translator identifies that mosque as being in heaven:
17:1 "The Aqsa Mosque" means "the farthest place where there is prostration," many billions of Light Years away. This verse informs us that Muhammad, the soul, was taken to the highest Heaven to be given the QuranAnd four years ago MEMRI translated an Egyptian article that claimed that the furthest mosque was in Medina:
This text tells us that Allah took His Prophet from the Al-Haram Mosque [in Mecca] to the Al-Aqsa Mosque. Thus, two mosques are [referred to] here, the first of which is the Al-Haram Mosque, and the second of which is the Al-Aqsa Mosque. 'Al-Aqsa' is a form of superlative which means 'the most distant.' Therefore, the place to which the Prophet was taken must be a mosque, and not a place where a mosque was to be established later, nor a place where a mosque had once stood. This place must be very far from the Al-Haram Mosque. It need not be [actually] built, as the Al-Haram Mosque [itself] was at that time merely an open space around the Ka'ba [and not a building].Of course, the Koran never mentions Jerusalem at all. Jerusalem's "Al Aqsa" mosque was built a hundred years later and named for this fairy tale.
"But in Palestine during that time, there was no mosque at all that could have been the mosque 'most distant' from the Al-Haram Mosque. During that time, there were no people in [Palestine] who believed in Muhammad and would gather to pray in a specific place that served as a mosque. Most of the inhabitants of Palestine were Christians, and there was among them a Jewish minority. Although the Koran refers respectfully to Jewish and Christian houses of worship, it does not call any of them a mosque, rather 'churches and synagogues' (Surat Al-Hajj :40). The construction of the mosque situated today in Jerusalem and known as the Al-Aqsa Mosque began only in the year 66 of the Hijra of the Prophet – that is, during the era of the Omayyad state, not during the time of the Prophet nor that of any of the Righteous Caliphs. So much for the mosque."
"As for the word asra, if we open the Koran and trace the instances in which it occurs we find the following [five] verses.…  Hence [the verbal noun] isra' means 'moving secretly from a place of danger to a safe place.' The meaning of the [Koranic] expression 'He took His servant by night' is that He ordered him to journey in secret from his enemies to a place where he and his mission would be secure. In other words, the text speaks of the Hijra of the Prophet from Mecca to Medina, and not of a visit to Palestine. [Indeed], the Hijra of the Prophet [to Medina] was carried out unbeknownst to his enemies.
But since Islam can't stand to see Jews controlling Jerusalem, the lie that the Koran refers to that city will continue for a long time.