Fatimid Cairo was surrounded by walls of mudbrick that had been commissioned by Gawhar al-Siqilli to protect the city during the reign of Caliph al-Mu‘izz li-Din Allah (358-365 AH / 969-975 AD). In 480 AH / 1087 AD, the vizier Badr al-Gamali ordered that the walls be expanded and rebuilt in stone. This coincided with the reign of Caliph al-Mustansir (427–487 AH / 1036–1094 AD).
These Fatimid walls had huge eight gates. some of them have collapsed, while others still remain. Al-Futuh and al-Nasr lay on the northern side. On the southern walls were Zuwayla and al-Farag. Al-Qarratin and al-Barqiyya were on the east, and Sa‘ada and al-Qantara on the west.
Sultan Salah al-Din (567-589 AH/1171-1193 AD) extended the gates farther in the Ayyubid Period to include all four capitals of Islamic Egypt: al-Fustat, al-‘Askar, al-Qatai‘, and al-Qahira. The defensive center of this large city was the citadel of Salah al-Din, today simply known as the Cairo Citadel.