The Church of the Holy Wisdom, known as Hagia Sophia (latin Sancta Sophia)and Ayasofya or Aya Sofya in Turkish. From the date of its construction in 537 until 1453, it served as an Orthodox cathedral and seat of the Patriarch of Constantinople, except between 1204 and 1261, when it was converted to a Roman Catholic cathedral under the Latin Empire. The building was a mosque from 29 May 1453 until 1931. It was then secularized and opened as a museum on 1 February 1935.
The Hagia Sophia was built in the remarkably short time of about six years, being completed in 537 ce. Unusual for the period in which it was built, the names of the building’s architects—Anthemius of Tralles and Isidorus of Miletus—are well known, as is their familiarity with mechanics and mathematics. The Hagia Sophia is a component of a UNESCO World Heritage site called the Historic Areas of Istanbul, which includes that city’s other major historic buildings and locations.
The original church on the site of the Hagia Sophia is said to have been built by Constantine I in 325 on the foundations of a pagan temple. It was damaged in 404 by a fire that erupted during a riot following the second banishment of St. John Chrysostom, then patriarch of Constantinople. It was rebuilt and enlarged by the Roman emperor Constans I. The restored building was rededicated in 415 by Theodosius II. The church was burned again in the Nika insurrection of January 532, a circumstance that gave Justinian I an opportunity to envision a splendid replacement.
The structure now standing is essentially the 6th-century edifice, although an earthquake caused a partial collapse of the dome in 558 (restored 562) and there were two further partial collapses, after which it was rebuilt to a smaller scale and the whole church reinforced from the outside. It was restored again in the mid-14th century. For more than a millennium it was the Cathedral of the Ecumenical Patriarchate of Constantinople. It was looted in 1204 by the Venetians and the Crusaders on the Fourth Crusade. After the Turkish conquest of Constantinople in 1453, Mehmed II had it repurposed as a mosque, with the addition of minarets (on the exterior, towers used for the summons to prayer), a great chandelier, a mihrab (niche indicating the direction of Mecca), a minbar (pulpit), and disks bearing Islamic calligraphy.