By the time of the powerful Fatimid vizier Badr al-Jamali, who ruled Egypt from 1074 to 1094, Cairo had outgrown the sun-dried brick wall of Jawhar. This, coupled with the attempts of the Turkoman Atsiz to take Cairo, among other threats from the East, spurred al-Jamali to rebuild the walls of the city. The Gate of Zuwayla, or the Bab Zuwayla, was the third gate built under al-Jamali. The Bab al-Futuh and Bab al-Nasr were built in 1087, and the Bab Zuwayla in 1092. The Bab al-Futuh and Bab Zuwayla mark the northern and southern limits respectively of the Fatimid city and function as termini for al-Mu'izz Street, the major Fatimid north-south spine of the city.
An Armenian himself, al-Jamali is reported to have employed Armenians from northern Mesopotamia as well as Syrians in a vast building campaign which he embarked on shortly after he assumed power. This work marks the beginning of a newly cultivated taste for stone in Cairo. The Byzantine and north Syrian stone details and techniques demonstrate the most direct encounter between neighboring regional building traditions, manifested in the importation of architects and possibly of manpower.
Each of the three gates comprises two massive towers, which are square in Bab al Nasr and rounded in Bab al Futuh and Bab Zuwayla. The towers flank a recessed, highly articulated gateway and are joined above the gateway by a curtain wall. The three gates demonstrate remarkable architectural and iconographic features hitherto unknown in Muslim Egypt. For example, spherical-triangle pendentives are employed to carry the dome over the entrance-passage of Bab al-Futuh and Bab Zuwayla, and the room which occupies the upper part of each tower of Bab al-Nasr.
Also without antecedents in Egyptian architecture is the intersection of rising tunnel vaults, a feature to be seen in the great Staircase Tower west of Bab al-Futuh, in the staircase rising to the platform of Bab al-Nasr, in the small staircase descending from the same platform to the rampart walk, and in the gallery which crosses Bab al-Futuh. The use of the semicircular arch, along with the horizontal arch, with the complete absence of the pointed arch, is an anomaly in Fatimid Cairo.
Antecedents of the scalloped-arched panels of Bab Zuwayla in Islamic architecture can be found in palaces and mosques of Samarra, and on the minaret of the Great Mosque of Aleppo (1089-90) which is almost contemporary with the Bab Zuwayla.
The new Syrian taste for stone, which appropriates classical details in non-classical schemes, as exemplified by the Aleppo minaret, resonates through the three gates of Badr al Jamali. The arabesque medallions at the apex of the panels on the towers of Bab Zuwayla and the medallion on the keystone of the vault of the loggia above its great archway are representative of Fatmid techniques.
Named after the Fatimid soldiers from the Berber tribe al Zawila who settled near the site of the original gate in 969, Bab Zuwayla was also named Bab al-Mitwalli in the Ottoman period since the wali of the janissaries resided near the gate. It was first the site of great Mamluk ceremonials and processions, and later used for executions. From the towers rise the two minarets of the Mosque of al Mu'ayyad, built in 1415-22. Apart from being great representatives of Islamic military architecture, these fortifications, which were never put to the test by invaders, are particularly important for being among the very few examples of military work predating the Crusades.
In 2001, the Bab Zuwayla was the subject of careful restoration.