Despite 1,300 years of Muslim Arab rule, Jerusalem was never the capital of an Arab entity, nor was it ever mentioned in the Palestine Liberation Organization's covenant until Israel regained control of East Jerusalem in the Six-Day War of 1967. Overall, the role of Jerusalem in Islam is best understood as the outcome of political exigencies impacting on religious belief.
Mohammed, who founded Islam in 622 CE, was born and raised in present-day Saudi Arabia; he never set foot in Jerusalem. His connection to the city came years after his death when the Dome of the Rock shrine and the al-Aqsa mosque were built in 688 and 691, respectively, their construction spurred by political and religious rivalries. In 638 CE, the Caliph (or successor to Mohammed) Omar and his invading armies captured Jerusalem from the Byzantine Empire. One reason they wanted to erect a holy structure in Jerusalem was to proclaim Islam's supremacy over Christianity and its most important shrine, the Church of the Holy Sepulcher.
More important was the power struggle within Islam itself. The Damascus-based Umayyad Caliphs who controlled Jerusalem wanted to establish an alternative holy site if their rivals blocked access to Mecca. That was important because the Hajj or pilgrimage to Mecca was (and remains today) one of the Five Pillars of Islam. As a result, they built what became known as the Dome of the Rock shrine and the adjacent mosque.
To enhance the prestige of the 'substitute Mecca,' the Jerusalem mosque was named al-Aqsa. It means 'the furthest mosque' in Arabic, but has far broader implications, since it is the same phrase used in a key passage of the Quran called "The Night Journey." In that passage, Mohammed arrives at 'al-Aqsa' on a winged steed accompanied by the Archangel Gabriel; from there they ascend into heaven for a divine meeting with Allah, after which Mohammed returns to Mecca. Naming the Jerusalem mosque al-Aqsa was an attempt to say the Dome of the Rock was the very spot from which Mohammed ascended to heaven, thus tying Jerusalem to divine revelation in Islamic belief.
Jerusalem never replaced the importance of Mecca in the Islamic world. When the Umayyad dynasty fell in 750, Jerusalem also fell into near obscurity for 350 years, until the Crusades. During those centuries, many Islamic sites in Jerusalem fell into disrepair and in 1016 the Dome of the Rock collapsed.
Still, for 1,300 years, various Islamic dynasties (Syrian, Egyptian, and Turkish) continued to govern Jerusalem as part of their overall control of the Land of Israel, disrupted only by the Crusaders. What is amazing is that over that period, not one Islamic dynasty ever made Jerusalem its capital. By the 19th century, Jerusalem had been so neglected by Islamic rulers that several prominent Western writers who visited Jerusalem were moved to write about it. French writer Gustav Flaubert, for example, found "ruins everywhere" during his visit in 1850 when it was part of the Turkish Empire (1516-1917). Seventeen years later Mark Twain wrote that Jerusalem had "become a pauper village." Indeed, Jerusalem's importance in the Islamic world only appears evident when non-Muslims (including the Crusaders, the British, and the Jews) control or capture the city. Only at those points in history did Islamic leaders claim Jerusalem as their third most holy city after Mecca and Medina. That was again the case in 1967, when Israel captured Jordanian-controlled East Jerusalem (and the Old City) during the 1967 Six-Day War. Oddly, the PLO's National Covenant, written in 1964, never mentioned Jerusalem. Only after Israel regained control of the entire city did the PLO updated its Covenant to include Jerusalem.