The Mamluk sultan al-Ashraf Qaitbay ordered it after visiting the ruins of the old lighthouse in 1477, and the work was finished in 1479. It was meant to defend the city against attacks from the sea, at a time when Ottoman power was growing in the Mediterranean.
The lighthouse itself had kept working for centuries after the Arab conquest of Egypt. An earthquake in the 11th century damaged its octagonal section, leaving the base to serve as a watchtower with a small mosque on top, and two violent earthquakes in 1303 and 1323 brought the rest down. Qaitbay's fortress rose on those foundations, designed by his architect Qagmas al-Eshaqy, who later became viceroy of Alexandria. The building is said to have cost the sultan over a hundred thousand gold dinars.
The layout is easy to read on the ground. An outer wall studded with defensive towers encloses the whole site of about 17550 square metres, and an inner wall rings the courtyard, with rooms built into it that served as barracks and stores. From the entrance, visitors cross the courtyard to the main tower in the northwest corner: a massive square keep of three floors, with a half-round tower at each corner carrying projecting balconies for defence. Qaitbay also placed a mosque inside the fortress, and a water tank near the keep supplied the soldiers and their horses.
Later rulers kept returning to the fort because of where it stands. Sultan Qansuh al-Ghuri strengthened its garrison and had a decree carved in marble by the door to the courtyard, forbidding anyone to take weapons or gunpowder out of the tower on pain of hanging. The Ottomans garrisoned it after conquering Egypt; French troops took it in 1798; and Mohammad Ali Pasha repaired its ramparts and armed it with coastal cannon after 1805. The British bombardment of Alexandria on 11 July 1882 cracked the fortress and tore large gaps in its western façade.
Restoration came in stages through the 20th century: the Ministry of Defence repaired the upper floors in 1904, King Farouk ordered a quick renovation with a royal rest house in mind, and after the 1952 revolution naval troops made it into a Maritime Museum. The largest restoration campaign began in 1984, and further conservation and enlargement work followed in 2003.




