army regiments, and other people necessary to the operations of the regime and its city. Fustat remained for some time the main economic and urban center of Egypt. It was only later that Cairo grew to absorb other local cities, including Fustat, but the year 969 is sometimes considered the "founding year" of the current city. Al-Mu'izz, and with him the administrative apparatus of the Fatimid Caliphate, left his former capital of Mahdia, Tunisia, in 972 and arrived in Cairo in June 973. The Fatimid Empire quickly grew powerful enough to stand as a threat to the rival Sunni Abbasid Caliphate. During the reign of Caliph al-Mustansir (1036–1094), the longest of any Muslim ruler, the Fatimid Empire reached its peak but also began its decline. A few strong viziers, acting on behalf of the caliphs, managed to revive the empire's power on occasion. The Armenian vizier Badr al-Jamali (in office from 1073–1094) notably rebuilt the walls of Cairo in stone, with monumental gates, the remains of which still stand today and were expanded under later Ayyubid rule. The late 11th century was also a time of major events and developments in the region. It was at this time that the Great Seljuk (Turkish) Empire took over much of the eastern Islamic world. The arrival of the Turks, who were mainly Sunni Muslims, was a long-term factor in the so-called "Sunni Revival" which reversed the advance of the Fatimids and of Shi'a factions in the Middle East. In 1099 the First Crusade captured Jerusalem, and the new Crusader states became a sudden and serious threat to Egypt. New Muslim rulers such as Nur al-Din of the Turkish Zengid dynasty took charge of the overall offensive against the Crusaders. In the 12th century the weakness of the Fatimids became so severe that under the last Fatmid Caliph, al-'Adid, they requested help from the Zengids to protect themselves from the King of Jerusalem, Amalric, while at the same time attempting to collude with the latter to keep the Zengids in check. In 1168, as the Crusaders marched on Cairo, the Fatimid vizier Shawar, worried that the unfortified city of Fustat would be used as a base from which to besiege Cairo, ordered its evacuation and then set the city ablaze. While historians debate the extent of the destruction (as Fustat appears to have continued to exist after this), the burning of Fustat nonetheless