During its first construction, the Hagia Sophia was not intended to be a masjid and very little of it is used for prayer today. It was built in the year 360 as a cathedral under the rule of the Byzantine Empire (the eastern half of the Roman Empire) in the ancient city of Constantinople, which is current-day Istanbul, Turkey. The Hagia Sophia was rebuilt in the next century, but its current structure was not formed until 532 under Emperor Justinian’s rule. The rebuilding of this church came after a destructive riot and in response, Justinian ordered that a more majestic building be made to display his power to his subjects. Justinian commissioned a physicist and a mathematician to design the new building. Their expertise allowed the Hagia Sophia to be an impressive technical feat for its time.
One of the most notable aspects of the Hagia Sophia is its central dome. The architects used a complex system of vaults and semi-domes to support the dome, which has come to be known as the epitome of Byzantine architecture. However this system had its flaws, for it made the church vulnerable to earthquakes. One earthquake in 557 led to the collapse of the dome; to fortify the structure, the new dome was not only taller, but also built with more support.
Because of its size, the Hagia Sophia became the center of Eastern Christianity and was the largest church until 1520, when another cathedral was built in Spain. However, the city of Constantinople was conquered by the Ottoman Turks in 1453 and the Hagia Sophia was converted to a masjid. Until 1616, the Hagia Sophia was the primary masjid in Istanbul and was inspiration to several other masajid in the Ottoman Empire. The Hagia Sophia was in a poor state when the Turks arrived, so Sultan Mehmet II ordered its renovation. Part of its many improvements included a slightly off-centered mihrab. When the Hagia Sophia was rebuilt under Justinian, the church faced Jerusalem. To face Makkah however, the mihrab had to be off-center. Its most famous renovation under Ottoman rule began in 1846 under Sultan Abdulmecid. The interior and exterior were refurbished, and gigantic circular disks were installed on the interior columns of the masjid. These disks have the names of Allah, Prophet Muhammad ﷺ, his two grandsons Hassan and Hussein, Abu Bakr, Umar, Uthman, and Ali (radi Allah anhum).
In 1935, when Turkey became a republic, the Turkish president changed the Hagia Sophia from a masjid into a museum, although the minarets are still used by a muezzin to recite the adhan twice a day in the afternoon. The Hagia Sophia has undergone multiple changes throughout its history but what survives from its construction under Emperor Justinian is its magnificence and people’s widespread admiration for it.