Ayyubid walls thumb|Part of the eastern city wall, dating from the Ayyubid period (12th–13th centuries) and excavated in the last few decades (as seen from al-Azhar Park) Salah ad-Din, the founder of the Ayyubid dynasty, restored the Fatimid walls and gates in 1170 or 1171. He reconstructed parts of the walls, including the eastern wall. In 1176, he then embarked on a project to radically expand the city's fortifications. This project included the construction of the Citadel of Cairo and of a 20 kilometer-long wall to connect and protect both Cairo (referring to the former royal city of the Fatimids) and Fustat (the main city and earlier capital of Egypt a short distance to the southwest). The entirety of the envisioned course of the wall was never quite completed, but long stretches of the wall were built, including the section to the north of the Citadel and a section near Fustat in south. Work continued under subsequent Ayyubid sultans.
Ayyubid walls thumb|Part of the eastern city wall, dating from the Ayyubid period (12th–13th centuries) and excavated in the last few decades (as seen from al-Azhar Park) Salah ad-Din, the founder of the Ayyubid dynasty, restored the Fatimid walls and gates in 1170 or 1171. He reconstructed parts of the walls, including the eastern wall In 1176, he then embarked on a project to radically expand the city's fortifications. This project included the construction of the Citadel of Cairo and of a 20 kilometer-long wall to connect and protect both Cairo (referring to the former royal city of the Fatimids) and Fustat (the main city and earlier capital of Egypt a short distance to the southwest). The entirety of the envisioned course of the wall was never quite completed, but long stretches of the wall were built, including the section to the north of the Citadel and a section near Fustat in south. Work continued under subsequent Ayyubid sultans.