Jerusalem was central to the spiritual identity of Muslims from the very beginning of their faith. When the Prophet Muhammad first began to preach in Mecca in about 612, according to the earliest biographies, which are our primary source of information about him, he had his converts prostrate themselves in prayer in the direction of Jerusalem. They were symbolically reaching out toward the Jewish and Christian God, whom they were committed to worshipping, and turning their back on the paganism of Arabia. Muhammad never believed that he was founding a new religion that canceled out the previous faiths. He was convinced that he was simply bringing the old religion of the One God to the Arabs, who had never been sent a prophet before.
Consequently, the Koran, the inspired scripture that Muhammad brought to the Arabs, venerates the great prophets of the Judeo-Christian tradition. It speaks of Solomon's "great place of prayer" in Jerusalem, which the first Muslims called City of the Temple. Only after the Jews of Medina rejected Muhammad did he switch orientation and instruct his adherents to pray facing Mecca, whose ancient shrine, the Kabah, was thought by locals to have been built by Abraham and his son Ishmael, the father of the Arabs.
The centrality of Jerusalem in Muslim spirituality is apparent in the story of Muhammad's mystical Night Journey to Jerusalem. Muslim texts make it clear that this was not a physical experience but a visionary one (not dissimilar to the heavenly visions of the Jewish Throne Mystics at this time). One night Muhammad was conveyed miraculously from the Kabah to Jerusalem's Temple Mount. There he was welcomed by all the great prophets of the past before ascending through the seven heavens. On his way up he sought the advice of Moses, Aaron, Enoch, Jesus, John the Baptist and Abraham before entering the presence of God. The story shows the yearning of the Muslims to come from far-off Arabia right into the heart of the monotheistic family, symbolized by Jerusalem.
Respect for other faiths was manifest in Islamic Jerusalem. When Caliph Umar, one of Muhammad's successors, conquered the Jerusalem of the Christian Byzantines in 638, he insisted that the three faiths of Abraham coexist. He refused to pray in the Church of the Holy Sepulcher when he was escorted around the city by the Greek Orthodox Patriarch. Had he done so, he explained, the Muslims would have wanted to build a mosque there to commemorate the first Islamic prayer in Jerusalem.
The Jews found their new Muslim rulers far more congenial than the Byzantines. The Christians had never allowed the Jews to reside permanently in the city, whereas Umar invited 70 Jewish families back. The Byzantines had left the Jewish Temple in ruins and had even begun to use the Temple Mount as a garbage dump. Umar, according to a variety of accounts, was horrified to see this desecration. He helped clear it with his own hands, reconsecrated the platform and built a simple wooden mosque on the southern end, site of al-Aqsa Mosque today.