| The current building was originally constructed as a church between A.D. 532 and 537 on the orders of the Byzantine Emperor Justinian. Hagia Sophia is one of the greatest surviving examples of Byzantine architecture. Of great artistic value was its decorated interior with mosaics and marble pillars and coverings. The temple itself was so richly and artistically decorated that Justinian proclaimed, "Solomon, I have surpassed thee!"
At the capture of Constantinople during the Fourth Crusade 1204 , the church was ransacked and desecrated by the Latin Christians. Many relics from the church, such as a stone from the tomb of Jesus, the Virgin Mary's milk, the shroud of Jesus, and bones of several saints, were sent to churches in the West. After the recapture in 1261 by the Byzantines, the church was in a dilapidated state.
In 1453, Constantinople was conquered by the Ottoman Turks and Sultan Mehmed II ordered the building to be converted into the Ayasofya Mosque. The bells, altar, iconostasis, and sacrificial vessels were removed, and many of the mosaics were eventually plastered over. The Islamic features — such as the mihrab, the minbar, and the four minarets outside — were added over the course of its history.