The History of Hagia Sophia
The history of Hagia Sophia starts with a building that no longer exists. The church that stands in Sultanahmet today is the third on the site, begun in February 532 on the ashes of the second, and it has been an Orthodox cathedral, a Latin cathedral, an imperial mosque, a museum and a mosque again. Each role left something you can still see. This article follows the building through those roles in order; the dome, the mosaics and the Ottoman centuries have their own articles.

The first two churches of Hagia Sophia
Constantinople's first great church, called simply the Great Church, was consecrated in 360 under Constantius II, the son of the city's founder. It burned in 404 during riots that followed the exile of the patriarch John Chrysostom. Theodosius II built a second church, dedicated in 415; carved marble blocks from its porch, among them a frieze of lambs, lie in the excavated area beside today's west front.
Archaeologists have also found column capitals with Greek crosses, porphyry shafts, cornices and soffits from the Theodosian church, laid out by the west side. They are the only parts of the earlier buildings that visitors can see, and they show a basilica far smaller than what replaced it.
- 360: first church under Constantius II.
- 404: burned in riots over John Chrysostom's exile.
- 415: second church under Theodosius II.
- 532: burned in the Nika revolt.
The Nika revolt and the fire of 532
The second church lasted just over a century. In January 532 the Blues and Greens, the chariot-racing factions of the Hippodrome next door, turned a riot into a revolt against Justinian, chanting "Nika", "conquer". On 13 and 14 January the church burned to the ground along with much of the city centre. The court historian Procopius described the arsonists as having taken up arms "no less against God himself" and the church afterwards as "a charred mass of ruins".
Justinian nearly fled. The revolt was crushed in the Hippodrome by his generals, and the emperor turned the disaster into a building programme for the whole quarter, of which the new church was the centrepiece.
- Where it began: the Hippodrome, today's Sultanahmet Square.
- Who: the Blue and Green racing factions.
- When the church burned: 13 and 14 January 532.
- Rebuilding started: 23 February 532.
Justinian builds Hagia Sophia, 532 to 537
Justinian began again on 23 February 532, only weeks after the fire. He chose two men known for theory rather than masonry: Anthemius of Tralles, a mathematician, and Isidore of Miletus, a geometer and engineer. According to John the Lydian, the praetorian prefect Phocas paid for the first stage with 4,000 Roman pounds of gold. More than ten thousand people worked on the site.
Marble came from around the Mediterranean: white from the island of Marmara, green porphyry, pink stone from Afyon, yellow from North Africa; the Ministry page also names columns from Ephesus and eight from Egypt. The capitals were carved with the monograms of Justinian and Theodora. On 27 December 537, five years and ten months after the start, Justinian and Patriarch Menas inaugurated the church, and the emperor is reported to have said, "Solomon, I have surpassed thee." It remained the largest church in the world for more than five centuries.
Byzantine Hagia Sophia: cathedral and court
For the next nine centuries the church was the seat of the Patriarch of Constantinople and the stage for imperial ceremony, from coronations to the great feasts; Constantine VII described those rituals in detail in his Book of Ceremonies in the 10th century. The outside was clad in white marble and gilding that made it shine from the sea. The church also offered sanctuary to fugitives, though even Justinian's lawyers argued over whether murderers qualified.
- 620s: Heraclius has the cathedral's liturgical vessels melted into coins to pay for the war with Persia and a tribute to the Avars.
- 726-843: iconoclasm strips figurative images from the walls; nearly all the mosaics visible today were made after it.
- c. 954-955: Olga of Kiev is received by Constantine VII and probably baptised in the church's baptistery.
- 859, 869, 989: a fire and two earthquakes damage the vaults; after 989 the church reopens only on 13 May 994.
The structural story of those repairs is told in the article on the dome.

Hagia Sophia as a fortress in 1181
In 1181 the cathedral became a battlefield. Maria Komnene, daughter of Emperor Manuel I, and her husband Renier of Montferrat fell out with the regent Maria of Antioch and occupied Hagia Sophia with the patriarch's support. According to Niketas Choniates they turned the courtyard into a military camp, garrisoned the entrances with mercenaries and demolished houses around the square. Imperial troops fought them around the Milion and the outer narthex until a truce and an amnesty were agreed. Choniates compared the sparing of the church to Titus's efforts to save the Temple in Jerusalem.
- Occupiers: Maria Komnene and Renier of Montferrat.
- Opponent: the regent Maria of Antioch.
- Fighting: around the Milion and the outer narthex.
- Outcome: truce and amnesty.
Hagia Sophia under the crusaders, 1204 to 1261
The Fourth Crusade turned on Constantinople in 1204. Before the sack, emperors Isaac II and Alexios IV had already stripped gold ornaments and silver lamps to pay the crusaders; during it, according to Choniates, the altar was smashed and mules were led into the sanctuary to carry away the loot. On 16 May 1204 Baldwin of Flanders was crowned Latin emperor inside the church, and for 57 years it served as a Catholic cathedral.
Enrico Dandolo, the elderly Doge of Venice who had steered the crusade to the city, was buried inside in 1205. When the Byzantines retook Constantinople in 1261, the church was in poor condition. Andronikos II added four buttresses in 1317, paid for with his late wife's inheritance.
The last Byzantine years of Hagia Sophia
On 12 December 1452 Cardinal Isidore of Kiev proclaimed in Hagia Sophia the union of the Catholic and Orthodox churches agreed at the Council of Florence. Many Byzantines rejected it and stayed away from the building, calling it a haunt of demons. Five months later, as Ottoman troops broke through the land walls on 29 May 1453, crowds fled into it anyway; the historian Doukas wrote that within an hour the church was filled "upstairs, downstairs, in the courtyards". Those inside were taken captive, and the young and healthy were sold into slavery.
- 12 December 1452: church union proclaimed by Isidore of Kiev.
- 29 May 1453: the city falls; crowds shelter in the church.
- The same day: Mehmed II enters and orders the conversion.
Its story under the sultans is told in the conversion article.
Hagia Sophia from 1453 to today in one table
| Date | Event |
| 1 June 1453 | First Friday prayer; Aya Sofya becomes Istanbul's first imperial mosque |
| 1570s | Mimar Sinan strengthens the structure for Selim II and adds two minarets |
| 1847-1849 | Fossati brothers restore the building for Abdülmecid I |
| 19 January 1919 | A Greek military chaplain celebrates the only Orthodox liturgy since 1453, during the Allied occupation |
| 24 November 1934 | Cabinet decree makes it a museum; it opens in 1935 |
| 1985 | Listed by UNESCO with the Historic Areas of Istanbul |
| 1997-2006 | World Monuments Fund work on the roof and the dome interior |
| 10 July 2020 | Council of State annuls the museum decree |
| 24 July 2020 | First Friday prayer in the restored mosque |
| 15 January 2024 | Paid entry for foreign visitors via a separate gate |
Hagia Sophia as a museum, 1935 to 2020
Atatürk's government turned the mosque into a museum in 1935. The carpets were lifted and the marble floor reappeared, with the omphalion, the coronation circle of the emperors. The Byzantine Institute of America, led by Thomas Whittemore, had begun uncovering the mosaics in the early 1930s. During the Second World War the minarets held machine guns. Decades of neglect followed; the World Monuments Fund put the building on its watch lists in 1996 and 1998, when its copper roof was leaking onto the mosaics and rising groundwater was damaging the walls.
Grants from 1997 to 2002 paid for repairs to the roof and the dome, and the programme, which also trained young Turkish conservators, ended in 2006. By 2014 the museum drew about 3.3 million visitors a year, the second highest figure in Turkey.
Churches named after Hagia Sophia
- Saint Sophia, Kyiv: founded around 952, its name probably recalls Olga's baptism in Constantinople.
- Hagia Sophia, Thessaloniki: a Byzantine church built under the influence of the Constantinople model.
- Hagia Irene, Istanbul: the neighbouring church, rebuilt with a dome under Justinian.
- Saint Sophia's Cathedral, London: a 19th-century Greek Orthodox cathedral that borrows the name and style.
