The Hagia Sophia was probably the largest building on the worlds surface,barring the Egyptian Pyramids,or the Great Wall in China.For many centuries it was largest church and today  is the fourth largest in the world after St Pauls in London,St Peters in Rome and the Duoma in Florance.The great Ottoman architect Sinan,in his autobiography,says that he devoted his lifetime in attemp to surpass its technical achievements.

It was dedicated to the Hagia Sophia which means the Divine Wisdow,an attribute of Christ.

Todays Hagia Sophia is the third building built at the same place.The first one was a basilica with a wooden roof and was built in 390 AD.The orginal church Megale Ecclesia (Great Church) was burned down in rumpus in 404 AD.Teodiousius replaced it with a massive basilica which was burned down in Nika Revolt aganist Justinian in 532 AD.Justinian began rebulding the Hagia Sophia in the same year.The architects were two Anatolian geniuses,Anthemius of Tralles,an engineer and mathematician and Isidorus of Miletus,an architect .They started collecting materials from all over the empire.

In the construction ten thousand workers worked under the supervision of one hundred master builders.Justinian reopened it 537 entering the Hagia Sophia with words Solomon I have surpassed you.!!!.Because the building is near a fault line in a earhquake zone and the city passed through many riots and fires,the Hagia Sophia was destroyed and underwent restorations several times.Another major  even during the Byzantine period was the removal of all religious images from the church in iconoclastic period.During the Fourth Crusade in 1204 the church was pillaged and some  disgustingevents took place in the Hagia Sophia.After conquering Constaniple in 1453,Sultan Mehmet immediately went to the Hagia Sophia and ordered that it be converted to mosque.

This was done by adding the Islamic elements such as minarets,the mihrab and minber all of which were appropriatelu positined to face toward to Mecca,10 degrees south of the main axis of the building.Ayasofya was used as a church  for 916 years and as a mosques for 481 years.In 1934 It was made a museum and has since been open to visitors by the order of Mustafa Kemal Ataturk.