The historical church rises across the Blue Mosque in Eminönü district. It was known as “Megale Ekklesia” (Great Church) during the first construction phase of the monument and its present name “Aya Sofia” has been used since late fifth-century. It was inagurated on February 15th, 360 A.D and partially on fire in 404 A.D. Later, it was under repair in the reign of Teodosios II.(405-450 A.D) and was inagurated October 10th, 415 A.D. After the second riot in 532, the Hagia Sophia were completely burnt down. After the second fire, the current building was originally constructed as a church between 532 and 537 AD by Iustinianos. It was designed by two architects, Isidore of Miletus and Arthemius of Tralles, that they were originally from Western Anatolia.The columns and stones were brought to Istanbul from various places for construction of Hagia Sofia. A hundred foremen and ten thousand workers were employed in construction of the Hagia Sofia. The construction work continued five years and it was inagurated on December 27th, 537 A.D
A new period began after the conquest of Istanbul by Sultan Mehmed II.(1432 - 1481) in 1453 A.D. The Hagia Sophia was converted to a mosque in the period of Sultan Mehmed II. which had been used as a church for centuries. The wooden minaret was added to the direction of the western section of the mosque where the half-dome have existed. One minaret during the reign of the Bayezit II. (1470-1520), two more minarets in the period of Sultan Selim II. were added to the sanctuary. The library next to the sanctuary was built in 1739, the fountain which is one of the most charming samples of the Ottoman fountain Architecture (1740), muvakkithane (time keeping Room) and Sıbyan Mekteb (Ottoman elementary-primary school) (1740) were added during the reign of Sultan Mahmut I. (1730-1754). Additionally, the niche, müezzin mahfili (a gallery for the call to prayer) and the sermon bench are masterpieces with their workmanship which were thought to be extant 16th century.
The primary structure is entered through nine different doors. The central massive dome diameter of which is 32 meters and 55,6 meters high at its central point. The dome is supported on four columns with 24,3 meters height. The white marble capping that is covering the nave of the mosque is brought from Marmara Islands, light pink marbles with light green shadows is brought from Afyon, green porphyries are from Tesalya and Mora, porphries are from Egypt. yellow mables are brought from Algeria. The ceiling structure of the side naves are paved with golden mosaics and walls are covered with the fantastic ceramics and colourful stones from place to place. New gigantic circular-framed disks were hung on columns by the calligrapher Kazasker İzzed Effendi (1801-1877).
There are many sarcophaguses belonging to the Ottoman Sultans around the Hagia Sophia. In addition to the sarcophaguses of Selim II (1524-1574), Sultan Murad III (1546-1595), Sultan Mustafa I.(1591–1639) and Sultan Ibrahim (1616–1648), some of the family members of the Ottoman dynasty are also buried around there.
Th. Whittemore, An American Byzantine Art Historian, has started in order to remove the covered colourful pictures and the mosaic layer of the St Sophia by courtesy of Turkish Republic. While research has been done, the building has been transformed into a museumn in 1934 and opened to visitors in 1935. Today, the restoration works in the building, which is open to domestic and foreign visitors, are still continuing.