Just another case of an ages old tradition amongst the major religions of squatter's rights? 
And so it goes...
Richard
Jerusalem: A Pasionate History of a Unique and Inspiring City by Leon Uris, pp 158-160.
The Jerusalem Connection
With the death of Mohammed rule passed to his right-hand man, Abu Bakr, the first of the caliphs, who completed the conquest of the Arabian Peninsula and began the chore of compiling Mohammed’s message in the Koran.
It had long been the dream of Mohammed to convert the Syrian province, a job which fell to the second Caliph, Omar. Omar’s inspired forces stormed out of the desert and overmatched the threads of a wearying Byzantine army in the battle of the Yarmuk River.
With aim being taken on Jerusalem, Bishop Sophronius, the Eastern Orthodox Patriarch, with a silken tongue sued for a peace that would spare the city. The takeover was conditioned on Omar’s personally coming to Jerusalem. Few conquerors had passed up the temptation to plunder Jerusalem but Omar venerated it as an integral part of the new Islamic religion.
When Mohammed had been rebuffed by the Jews of Medina, one of the changes he ordered in the ritual was to cease facing Jerusalem during prayer, instead turning to Mecca and the shrine of the Kaaba. Yet, despite Mohammed’s downgrading of Jerusalem and the Jews, he and succeeding generations of Moslems kept a reluctant sort of love-hate respect for Judaism as the old and parent religion. Since Jesus, Adam, Moses, and Noah were locked in as Moslem prophets and Abraham was claimed as the Arab patriarch and Judaism and Christianity were used in the creation of Islam, it was natural, almost mandatory, to establish a foothold in Jerusalem. Both the Jews and the Christians had unalterable foundations in the holy city. The problem with Islam was that it had neither history nor experience in Jerusalem and therefore some connection had to be invented.
What was conjured up was a mythical visit by Mohammed to Jerusalem to establish Moslem claims to the city.
Mohammed was awakened by the Angel Gabriel in Mecca and advised that he was to take a night journey to paradise. In preparation for the trip, Gabriel slit Mohammed’s body open, removed and washed his heart and when it was returned to him it was filled with faith and wisdom. Sewn up and ready to travel, Mohammed mounted a magic mare named el-Buraq. This incredible beast had a woman’s face, a mule’s body and a peacock’s tail and could travel as far as the eye could see in a single stride.
Accompanied by Gabriel, who winged it, Mohammed took no time at all to reach “the fartherest place.” “The fartherest place” is an obscure phrase in the Koran with no further amplification. Moslem holy men have interpreted “the fartherest place” to mean Jerusalem, although Jerusalem is never mentioned by name. Non-Moslem scholars say that the message could or could not have meant Jerusalem.
Mohammed arrived, tethered his horse at the Wailing Wall, then went up to the Temple Mount. Here he discovered the Rock of Abraham’s sacrifice, which had also been the altar in the Temple’s Holiest of Holies. Mohammed then leaped from the Rock onto a ladder of light which led to paradise. The Rock started after Mohammed but Gabriel ordered it to remain and it obeyed.
Once again on his mount, Mohammed rode through the “seven heavens.” At one point he led the patriarchs, the Old Testament prophets and the angels in prayer. Moses was described as a ruddy-faced man and Jesus as of medium height and freckled. Abraham, it appears, was the mirror image of Mohammed. After gaining all the wisdom of Solomon, Mohammed was given the rare privilege of a private audience during which he saw God or Allah, unmasked. Allah wanted his subjects to pray to him thirty-five times a day but Mohammed talked him into a more practical five-a-day ritual. He then returned to Mecca the same night.
A few Moslems may admit that it was really a vision or a dream but the overwhelming mass of practicing Moslems and their priests take the fundamental view that this is a literal account. And thus Jerusalem was tied to the Islamic religion.
The conquest of the Caliph Omar began centuries of Moslem occupation. He did not go up to Jerusalem as a military victor but went alone on a camel. His first acts were to insure the sanctity of the Christian holy sites. When shown the Holy Sepulchre, Omar declined to go inside but prayed outside and today the site of his prayer is marked by a mosque.
Immediately after his arrival Omar asked to be taken to the Temple Mount. The Patriarch Sophronius hemmed and hawed, for the Christians had long used it as a garbage dump. When Omar reached it and found how it had been desecrated he forced Sophronius to crawl through the refuse on his hands and knees as atonement.
Omar erected a simple wooden mosque on the Mount to denote “the fartherest place” of Mohammed’s journey. The original mosque, temporary in construction, was eventually replaced by the grand Al Aksa Mosqque, which stands on the southern fringe of the Temple Mount plaza. The words “Al Aksa” are Arabic for “the fartherest place.” Omar had nothing to do with the building of the dome over the Rock which had been misnamed the Mosque of Omar.
The Caliph Omar’s rule was considered wise and moderate, with the Arabs retaining the established civil governmental structure headquartered in Caesarea. Over the objection of Sophronius, Omar permitted the Jews to return to Jerusalem.