The Lighthouse of Alexandria survived well into Medieval times. In 1165 an Arab traveler wrote “The Pharos rises at the end of the island” and followed with detailed measurements. Perhaps his account informed this 12th century Persian illustration from the Mojmal al-tawariḵ wa’l-qeṣaṣ?
The design for the Torre de Hércules lighthouse in Spain was said to be based on the Great Lighthouse of Alexandria - one of Antipater of Sidon’s Seven Wonders of the World. This fanciful illustration is from the New Geographical Dictionary, 1790
Even older than the Hagia Sophia is the second century Torre de Hércules in Galicia, Spain. Excluding tombs (which, in a sense, are always occupied) perhaps only one or two other continually used buildings in the world are old as this lighthouse.
(photograph by Fernando Méndez)