El-Hakim Mosque is the second largest Fatimid mosque in Cairo. The mosque was started in 990 by the Caliph El-Aziz and was completed in 1013 by his son El-Hakim who was the founder of the Egyptian Druze sect. Over its lifetime, the building has served as a prison for captive Crusaders, Napoleon's warehouse, Salah al-Din's stable and a boys' school under Nasser. Very little of the original history remains after a restoration by an Ismaili Shi-i sect. The mosque has been encased in marble and only the wooden tie-beams and stucco carvings remain of the original decorations. The minarets were not destroyed as Hakim had them encased in large square buttresses. These minarets are the oldest surviving minarets in Cairo as they stand at the outer walls of the mosque. The bases are original, however the tops were replaced in 1303 after an earthquake destroyed the upper stories. The new tops are from the Mamluk period. An interior staircase leads to the city's ramparts and a rampart walk that date from the 12th century.