Just over four and a half centuries had passed since Jerusalem had come under Muslim rule. In AD 614, after a twenty-day siege, Byzantine Jerusalem had been conquered by the Persians. Although the city was recaptured fourteen years later by Emperor Heraclius, the Persian victory of 614 heralded the approaching end of Christian Jerusalem. Two decades later, between AD 636 and 638 the Holy City fell to the Muslim army of Caliph ‘Umar. For the next four and a half centuries Jerusalem was held by a succession of Muslim military governors representing foreign rule: the Umayyads ruling from Damascus until 750, the Abbasids from Baghdad until 878, the Egyptian Tulunid caliphate from 868 to 905 and Fatimid caliphate from 969 until 1073. In June of that year the Turkish Seljuks took the city and in 1098, one year before the arrival of the army of the First Crusade, Jerusalem reverted to Fatimid rule.
In general, under the Muslims the physical layout of Jerusalem differed little from that of the Byzantine city. The only major change was the eleventh-century reconstruction of the city wall in the south, which left the City of David and Mount Zion outside the walls, and the realignment of the north-west wall somewhat further to the west. However, major alterations were made to the urban infrastructure by the construction of many new and remarkable public buildings. The most important of these were the Dome of the Rock, the al-Aqsa Mosque and the Umayyad palaces south of the Temple Mount (Haram al-Sharîf).
The population of Jerusalem in the Fatimid period approached twenty thousand. It was a diverse amalgamation of Jews, various communities of Eastern Christians and Muslims. Several hundred years after the Islamic conquest, the Muslims may still not have been the majority and do not appear to have been entirely in control of the city. Christian and Jewish pilgrimage continued, in spite of the difficulties and dangers involved.
Nasir-i Khosraw described Jerusalem as a great city with strong walls, iron gates, high, well-built bazaars and paved streets. The Seljuk occupation of the city from 1073 until 1098 has left no evidence for any major construction in that period. However, there is evidence for a religious-intellectual revival in the city after a certain spiritual drought under the Fatimids. In August 1098, the Fatimids under the command of the vizier, al-Afdal ibn Badr al-Jamâlî, reoccupied Jerusalem. In preparation for the anticipated arrival of the Crusader armies, which by that time were approaching Antioch, the Fatimid governor Iftikhâr al-Dawla stationed in the city a large, welltrained army augmented by a special Egyptian corps of 400 élite cavalry. The Muslims prepared for the arrival of the Crusaders by strengthening the city walls, particularly in the north, where they built or strengthened an existing barbican and ditch, and on Mount Zion, where they cut another ditch and possibly reconstructed the forewall. Residents of surrounding villages moved inside the walls, and the greater part of the Christian population was expelled from the city to the outlying villages. The latter was a precaution against possible treachery on the part of the Christians, who were understandably suspected of harbouring aspirations of a return to Christian rule.