The Hagia Sophia was built in 532–537 for the Byzantine emperor Justinian I and was inaugurated on 27 December 537. It served as a church for about 916 years, became a mosque after the Ottoman conquest in 1453, was a museum from 1934 until 2020, and has been a mosque again since 24 July 2020. Today it is undergoing the largest restoration of the Turkish Republic era.
The first two churches: 360 and 415
The present Hagia Sophia is the third church on this site. The first was consecrated in 360 under Emperor Constantius II. It had a wooden roof and burned down during riots in 404. A second church, designed by the architect Rufinus, was dedicated in 415 under Theodosius II. It burned in turn during the Nika revolt of 13–14 January 532.
Justinian's Hagia Sophia (532–537)
Weeks after the Nika revolt, Justinian I began a new church on the site. His architects were Anthemius of Tralles and Isidore of Miletus. Work took five years and ten months, and on 27 December 537 Justinian and Patriarch Menas inaugurated the building.
The heart of the design was a vast dome, now about 31 m across, resting on a ring of 40 windows above the nave. Byzantine writers compared the floor to a sea. The Hagia Sophia remained the largest church in the world for about 500 years, until Cluny Abbey in the 12th century, and the seat of the Patriarchate for nearly 1,000 years.
The dome collapse and rebuilding (558–562)
An earthquake in 558 brought down the first dome. Isidore the Younger rebuilt it about 6 m (20 Byzantine feet) higher. The new dome was finished in 562; its crown stands 55.6 m (182 ft) above the floor.
1204: the Fourth Crusade
In 1204 the armies of the Fourth Crusade sacked Constantinople and the Hagia Sophia. Baldwin I was crowned Latin emperor in the church on 16 May 1204, and it served as a Latin cathedral until the Byzantines returned in 1261. Doge Enrico Dandolo, who died in 1205, is commemorated in the east gallery. The Deesis mosaic in the gallery probably dates from 1261, the year Byzantine rule was restored.
1453: from church to mosque
On 29 May 1453 the Ottoman army under Sultan Mehmed II took Constantinople. Mehmed II ordered the Hagia Sophia to be converted into a mosque, and the first Friday prayer was held on 1 June 1453. It remained a mosque for the next 481 years.
Ottoman additions
The Ottomans added the features that define the Hagia Sophia's outline today:
- Four minarets: the red-brick south-east minaret (from the time of Mehmed II or Bayezid II), the slender north-east minaret of Bayezid II, and the two larger western minarets of about 60 m from the reign of Selim II, by the architect Mimar Sinan.
- Buttresses and tombs: Mimar Sinan strengthened the building with buttresses under Selim II and built the sultan's tomb in 1576–77. The tombs of Murad III, Mehmed III and Mustafa I followed.
- A mosque complex: Mahmud I added a medrese, a soup kitchen, a library and the ablution fountain (şadırvan) in 1739–40.
- The Fossati restoration: in 1847–1849 Sultan Abdülmecid I had the brothers Gaspare and Giuseppe Fossati restore the building with 800 workers.
- The great roundels: eight giant calligraphic roundels by Kazasker Mustafa İzzet Efendi, with the names of Allah, the Prophet Muhammad, the four caliphs, Hasan and Husayn.
1934–2020: the Hagia Sophia museum
The Hagia Sophia closed in 1931. Under Atatürk, the decision to turn it into a museum was taken in 1934, and the museum opened in 1935. Carpets came up, and the Omphalion, the marble coronation spot in the floor, was uncovered. In 1985 the Hagia Sophia became part of the UNESCO World Heritage site "Historic Areas of Istanbul".
2020: a mosque again
On 10 July 2020 the Council of State annulled the decree that had made the Hagia Sophia a museum. A turquoise carpet was laid on 22 July, and the first Friday prayer took place on 24 July 2020. The Hagia Sophia is now officially the Hagia Sophia Grand Mosque (Ayasofya-i Kebir Cami-i Şerifi). Since then, about 40 million people have visited.
2024: the paid visitor route
On 15 January 2024 worshippers and tourists were given separate entrances. Worshippers enter the prayer hall free, while foreign visitors pay €25 for a route through the upper gallery. Read how it works on our page about the upper gallery visit and on our Hagia Sophia tickets page.
The restoration today
In 2025 the largest restoration of the Republic era began. The lead covering of the main dome was removed so that the dome could be strengthened, and in July 2026 a temporary steel roof with a membrane was placed over it. The Bayezid II minaret has been restored, and work on the other minarets is in progress. In September 2026 the work moved to the eastern half-dome, described as the weakest part of the building. Worship and visits continue, and most of the work is planned to be finished in 2027.
Beneath the building, archaeologists documented seven early-Byzantine tunnel lines in 2026, along with water channels, vaulted rooms and a tomb. Plans to open them to visitors have been announced, but they are not open yet.
Hagia Sophia timeline
- 360 First church consecrated under Constantius II.
- 404 First church burns during riots.
- 415 Second church dedicated under Theodosius II.
- 532 Second church destroyed in the Nika revolt; construction of the present building begins.
- 537 Justinian's Hagia Sophia inaugurated on 27 December.
- 558 Earthquake brings down the dome.
- 562 Higher dome by Isidore the Younger completed.
- 1204 Fourth Crusade; Latin cathedral until 1261.
- 1453 Ottoman conquest; first Friday prayer on 1 June.
- 1576–77 Mimar Sinan builds the tomb of Selim II.
- 1739–40 Mahmud I adds a medrese, library and ablution fountain.
- 1847–1849 Fossati restoration.
- 1931 Hagia Sophia closed.
- 1934–35 Museum decision and opening.
- 1985 UNESCO World Heritage, as part of the Historic Areas of Istanbul.
- 2020 Mosque again; first Friday prayer on 24 July.
- 2024 Separate paid visitor route from 15 January.
- 2025–2027 Major restoration of the dome, half-domes and minarets.
For numbers and curiosities, see our Hagia Sophia facts, and to see the story told in immersive rooms, visit the History and Experience Museum.