Originally founded in 1176 by the Muslim leader Saladin, who built the mighty walls and towers with stone blocks taken from the Pyramids of Giza, the fortress was the seat of power for 700 years. Egypt's heads of state moved away from the medieval quarters around 1875, choosing the recently built Abdin Palace as their home, but the citadel retained its military role until the 1970s. Although the army still retains parts of the complex with restricted access, most of the structure is open to the public and it is possible to spend half a day visiting the mosques, museums and other monuments enclosed within the walls.