The History of Hagia Sophia: From Church to Mosque (2026)

History of Hagia Sophia from church to mosque

Hagia Sophia was built by Byzantine Emperor Justinian I and completed in 537 AD. It served as the patriarchal cathedral of the Eastern Orthodox Church for 916 years. After the Ottoman conquest of Constantinople in 1453, Mehmet II converted it to a mosque. In 1934, Atatürk converted it to a secular museum. In 2020, Turkish President Erdoğan reconverted it to an active mosque, where it remains today. It has been a UNESCO World Heritage Site since 1985.

Few buildings in the world carry as much history as Hagia Sophia. In 1,487 years of continuous existence, it has functioned as the greatest cathedral in Christendom, an imperial Ottoman mosque, a secular museum, and an active mosque once again — each transition reflecting a seismic shift in the political and religious organisation of the world around it. Understanding this history is the prerequisite for understanding what you are looking at when you visit.

Before Justinian: The Earlier Churches

Two earlier churches occupied the site of Hagia Sophia before the current building. The first, a wooden-roofed basilica commissioned by Emperor Constantine I, was completed around 360 AD and burned down during a riot in 404 AD. The second was built by Emperor Theodosius II, completed in 415 AD, and destroyed during the Nika riots of 532 AD. The ruins of the Theodosian church — including a carved marble doorstep — were discovered during excavations in the 1930s and are now displayed near the site.

The site of Hagia Sophia has been a place of Christian worship since the 4th century, but the building that stands today is entirely the creation of the Emperor Justinian I. When the Nika riots of January 532 AD — the most devastating urban uprising in Byzantine history, which killed perhaps 30,000 people in five days — destroyed the Theodosian church, Justinian used the disaster as an opportunity to build something entirely without precedent.

The Justinianic Construction (532–537 AD)

The current Hagia Sophia was commissioned by Byzantine Emperor Justinian I immediately after the Nika riots of 532 AD. Construction began in February 532 and the building was consecrated on 27 December 537 — a construction period of less than six years. The architects were Anthemius of Tralles (a mathematician and physicist) and Isidore of Miletus (a professor of geometry at the Academy in Athens). The building’s central dome — 31 metres in diameter, rising 55.6 metres above the floor — was the largest in the world at the time of its completion and remained so for nearly a thousand years.

Justinian engaged two men not primarily known as architects but as mathematicians and theorists: Anthemius of Tralles and Isidore of Miletus. Their approach was to solve a structural problem that had never been fully solved before — how to place a circular dome on a square base. The solution, using curved triangular surfaces called pendentives to transition between the square and the circle, had been used before but never at this scale or with this ambition.

The building materials were sourced from across the empire: porphyry columns from Egypt, green marble from Thessaly, yellow stone from Syria, black stone from the Bosphorus region. The interior was decorated with gold mosaics, silver furniture, and silk hangings. Justinian reportedly said at the consecration: “Solomon, I have surpassed thee” — a reference to the Temple of Jerusalem and an unambiguous statement of imperial ambition.

The dome collapsed partially in an earthquake in 558 AD and was rebuilt by Isidore’s nephew with a higher profile — the dome as it stands today is a slightly modified version of the original.

The Byzantine Cathedral (537–1204 AD)

For 667 years, Hagia Sophia served as the patriarchal cathedral of the Ecumenical Patriarchate of Constantinople — the mother church of Eastern Orthodox Christianity and the spiritual centre of the Byzantine Empire. It was the site of:

  • Imperial coronations — Byzantine emperors were crowned here
  • Patriarchal elections and councils
  • The Great Schism of 1054, when the representatives of the Pope of Rome and the Patriarch of Constantinople excommunicated each other in the nave of the church, formally dividing Christianity into Catholic and Orthodox branches
  • The reading of the imperial proclamations that shaped Byzantine political life

The building accumulated extraordinary wealth during this period — relics, precious metalwork, silk vestments, and the gold mosaic programme that covered its surfaces. It was the largest cathedral in the world and the most ornate religious building in existence.

The Iconoclasm (726–843 AD)

Byzantine Christianity’s internal crisis over religious images — the Iconoclasm controversy — had a profound effect on Hagia Sophia. Between 726 and 843 AD, imperial decrees prohibited the veneration of religious images, and many of Hagia Sophia’s figural mosaics were removed or plastered over. The end of Iconoclasm in 843 AD — celebrated as the “Triumph of Orthodoxy” — was marked by the installation of the Virgin and Child apse mosaic, explicitly asserting the legitimacy of sacred images.

The Latin Occupation (1204–1261 AD)

The Fourth Crusade of 1204 — one of the most catastrophic events in Byzantine history — resulted in the sack of Constantinople by Western Crusaders who were supposed to be fighting in the Holy Land. Constantinople fell to Latin forces who installed a Latin emperor and a Latin patriarch. For 57 years, Hagia Sophia served as a Roman Catholic cathedral under Latin administration. The Crusaders stripped much of the building’s accumulated wealth — the golden altarware, the relics, the silver furniture — sending it to Western Europe.

The Byzantine recovery of Constantinople in 1261, led by Emperor Michael VIII Palaeologus, ended the Latin occupation. The building was returned to Orthodox use, and the commission of the Deesis Mosaic — the greatest surviving Byzantine artwork in the building — may have been part of the post-recovery restoration programme.

The Ottoman Conversion (1453 AD)

Hagia Sophia was converted from a Christian cathedral to a Muslim mosque on 29 May 1453, the day Constantinople fell to the Ottoman forces of Sultan Mehmet II. According to historical accounts, Mehmet II rode his horse into the building, ordered an imam to perform the first Muslim prayer, and had the Byzantine patriarch’s throne and altar removed. The figurative mosaics were plastered over, a mihrab (prayer niche indicating the direction of Mecca) was added, and four minarets were constructed over the following centuries. The building served as the imperial Friday mosque — the principal mosque of the Ottoman Empire — for the next 481 years.

The Ottoman additions to Hagia Sophia were substantial and systematic:

Immediate changes (1453): A mihrab was installed slightly offset from the church’s east-facing altar — because Mecca is to the southeast of Istanbul, the direction of prayer (qibla) does not align with the church’s original orientation. The altar, the patriarch’s throne, and the baptistery were removed. The figurative mosaics were plastered over.

Minarets: Mehmet II added a single minaret in the 15th century. Bayezid II added a second. Selim II commissioned the architect Sinan to add two more in the late 16th century — the four minarets that give the building its current silhouette.

Structural reinforcements: The Ottoman architect Sinan — the greatest of the Ottoman imperial architects, who also built the Süleymaniye Mosque — added external buttresses to stabilise the dome, which had been damaged by successive earthquakes.

Interior additions: The large Ottoman calligraphic medallions bearing the names of Allah and the key figures of Islamic history were added in the 19th century during a restoration supervised by Swiss-Italian architects the Fossati brothers.

The Secular Museum Period (1934–2020)

Hagia Sophia was converted from a mosque to a secular museum in 1934 by decree of Turkish President Mustafa Kemal Atatürk. The conversion was part of Atatürk’s broader programme of Turkish secularisation and was intended as a gesture of cultural openness to both East and West. The Byzantine mosaics were uncovered during the museum period by American scholar Thomas Whittemore and the Byzantine Institute of America, beginning in the 1930s. The building was designated a UNESCO World Heritage Site in 1985 as part of the Historic Areas of Istanbul.

The museum period lasted 86 years and transformed Hagia Sophia into one of the world’s most visited cultural sites. The uncovering of the mosaics — including the Deesis, the Empress Zoe panel, and the Virgin and Child — gave the building a new significance as a monument of Byzantine art history as well as architectural history.

The 2020 Reconversion to a Mosque

On 10 July 2020, Turkish President Recep Tayyip Erdoğan signed a decree reconverting Hagia Sophia to an active mosque following a ruling by Turkey’s Council of State that Atatürk’s 1934 conversion had been unlawful under Turkish administrative law. The first Muslim prayer in 86 years was held on 24 July 2020. The reconversion was internationally controversial — UNESCO, the World Council of Churches, the Greek government, and many cultural organisations expressed concern or condemnation. The Turkish government maintained that the decision was a matter of national sovereignty.

The practical implications of the reconversion for tourists were significant: free admission ended (a €25 entry fee was introduced in January 2024), and tourist access was restructured around the active religious use of the building — the ground floor prayer hall is reserved for worshippers, and tourists access only the upper gallery Visiting Area.

The Byzantine mosaics in the tourist-accessible upper gallery have not been re-covered following the reconversion.

Hagia Sophia Today

Hagia Sophia is simultaneously an active place of Muslim worship (the five daily prayers are held here, and Friday midday prayers draw significant congregations) and one of the world’s most visited tourist sites. This dual role — functioning monument and active mosque — defines the visiting experience in 2026.

The upper gallery (Visiting Area) is open to tourists daily from 9:00am to 7:30pm, with the exception of the Friday midday closure (12:30–14:30) when all tourist access is suspended for the prayer. Below, in the main prayer hall, Muslim worshippers continue to use the building for its primary function.

For the full practical visit guide, see our tips for first-time visitors and opening hours guide.

Timeline Summary

Year Event
~360 AD First church on the site (Constantinian basilica) completed
404 AD First church destroyed by fire during anti-Chrysostom riots
415 AD Second church (Theodosian) completed
532 AD Nika riots destroy the Theodosian church; Justinian commissions new building
537 AD Current Hagia Sophia consecrated on 27 December
558 AD Dome partially collapses in earthquake; rebuilt by Isidore the Younger
726–843 AD Iconoclasm: figurative mosaics removed or plastered over
843 AD End of Iconoclasm; Virgin and Child apse mosaic installed
1054 AD Great Schism between Catholic and Orthodox Christianity formalised in Hagia Sophia
1204 AD Fourth Crusade; Latin occupation begins; building becomes Catholic cathedral
1261 AD Byzantine recovery; building returns to Orthodox use
c. 1261 AD Deesis Mosaic created (Palaiologan Renaissance)
1453 AD Ottoman conquest; building converted to mosque
16th century Sinan adds minarets and structural buttresses
1934 AD Atatürk converts building to secular museum
1930s Thomas Whittemore uncovers Byzantine mosaics
1985 AD UNESCO World Heritage Site designation
2020 AD Reconverted to active mosque by decree of President Erdoğan
2024 AD €25 tourist entry fee introduced

Frequently Asked Questions

Who built Hagia Sophia?

Hagia Sophia was built by the Byzantine Emperor Justinian I. The architects were Anthemius of Tralles and Isidore of Miletus. Construction took less than six years (532–537 AD).

How old is Hagia Sophia?

The current building was completed in 537 AD — making it approximately 1,487 years old as of 2024. A church has stood on the site since approximately 360 AD, making the site itself over 1,660 years old.

Is Hagia Sophia a church or a mosque?

Since 2020, Hagia Sophia is an active mosque. It was a Christian cathedral for 916 years (537–1453), an Ottoman mosque for 481 years (1453–1934), a secular museum for 86 years (1934–2020), and has been a mosque again since 2020.

What does “Hagia Sophia” mean?

“Hagia Sophia” is Greek for “Holy Wisdom” — specifically the Divine Wisdom or Logos, understood in Eastern Orthodox theology as Christ himself. The building is dedicated to the Holy Wisdom of God, not to a saint named Sophia.

Is Hagia Sophia a UNESCO World Heritage Site?

Yes — Hagia Sophia is part of the Historic Areas of Istanbul, designated a UNESCO World Heritage Site in 1985.

Photo of author
Researched & Written by
Jamshed is a versatile traveler, equally drawn to the vibrant energy of city escapes and the peaceful solitude of remote getaways. On some trips, he indulges in resort hopping, while on others, he spends little time in his accommodation, fully immersing himself in the destination. A passionate foodie, Jamshed delights in exploring local cuisines, with a particular love for flavorful non-vegetarian dishes. Favourite Cities: Amsterdam, Las Vegas, Dublin, Prague, Vienna

Leave a Comment