For over 900 years Hagia Sophia was the home of the Christian Orthodox Patriarch of Constantinople. The Patriarch was an extremely important religious leader, and he held many significant meetings that influenced early Christianity in Hagia Sophia.
Unfortunately nothing remains of the original Hagia Sophia, which was built in the fourth century by Constantine the Great. Constantine was the first Christian emperor and the founder of the city of Constantinople, which he called "the New Rome." The Hagia Sophia was one of several great churches he built in important cities throughout his empire. Following the destruction of Constantine's church, a second was built by his son Constantius and the emperor Theodosius the Great. This second church was burned down during the Nika riots of 532 CE, though fragments of it have been excavated and can be seen today. Hagia Sophia was rebuilt in her present form between 532 CE and 537 CE under the personal supervision of Emperor Justinian I. It is one of the greatest surviving examples of Byzantine architecture, rich with mosaics and marble pillars and coverings.
Hagia Sophia remained a functioning church until May 29, 1453 CE, when Sultan Mehmet the Conqueror entered triumphantly into the city of Constantinople. He was amazed at the beauty of Hagia Sophia and immediately converted it into his imperial mosque. It then served as the principal mosque of Istanbul for almost 500 years. It became a model for many of the Ottoman mosques of Istanbul such as the Blue Mosque, the Suleiman Mosque, the Shehzade Mosque and the Rustem Pasha Mosque.
In 1934 CE, under Turkish president Kemal Atatürk, Hagia Sofia was secularized and turned into the Ayasofya Museum. The prayer rugs were removed, revealing the marble beneath, but the mosaics remained largely plastered over and the building was allowed to decay for some time. Some of the calligraphic panels were moved to other mosques, but eight large circular panels were left and can still be seen today. A 1993 UNESCO mission to Turkey noted falling plaster, dirty marble facings, broken windows, decorative paintings damaged by moisture, and ill-maintained lead roofing. Cleaning, roofing and restoration have since been undertaken; many recent visitors have found their view obstructed by huge scaffolding stretching up into the dome in the center of the building.