For almost a thousand years, the Ayasofya was a triumph of Christianity and the symbol of Byzantium, and until the 16th century, maintained its status as the largest Christian church in the world.
The cathedral is so utterly awesome that the Statue of Liberty's torch would barely graze the top. Erected over the ashes of two previous churches using dismantled and toppled columns and marble from some of the greatest temples around the empire, the Ayasofya (known in Greek as the Hagia Sophia and in English as St. Sophia, or Church of the Holy Wisdom) was designed to surpass in grandeur, glory, and majesty every other edifice ever constructed as a monument to God. Justinian began construction soon after his suppression of the Nika Revolt, indicating that combating unemployment was high on the list as well. He chose the two preeminent architects of the day: Anthemius of Tralles (Aydin) and Isidorus of Miletus. After 5 years and 4 months, when the construction of the Ayasofya was completed in A.D. 537, the emperor raised his hands to heaven and proclaimed, "Glory to God who has deigned to let me finish so great a work. O Solomon, I have outdone thee!" Enthusiasm for this feat of architecture and engineering was short-lived, because 2 years later, an earthquake caused the dome to collapse.
The new dome was slightly smaller in diameter but higher than the original, supported by a series of massive towers to counter the effects of future earthquakes. Glass fittings in the walls were employed to monitor the weight distribution of the dome; the sound of crunching glass was an early warning system indicating that the weight of the dome had shifted. Several more earthquakes caused additional damage to the church, requiring repairs to the dome (among other sections), which was increased in height thanks to the support provided by the addition of flying buttresses (additional buttresses were added at two later dates).
In 1204 the Ayasofya was sacked and stripped down to the bare bones by the Crusaders, a desecration that robbed the church of precious relics and definitively divided the Greek Orthodox and Roman Catholic churches.
After Mehmet II penetrated the city in 1453, his first official stop was to this overwhelming symbol of an empire that he had conquered, and with his head to the ground, he invoked the name of Allah and declared the great house of worship a mosque.
In the years that followed, several adjustments were made to the building including the covering over of the frescoes and mosaics, due to the prohibition of Islam against the representation of figures. (The Iconoclastic movement of the 8th and 9th centuries had similarly disavowed the use of figural depictions and icons, during which many of the frescoes and mosaics were defaced, destroyed, or cemented over; any figural representations seen today date to after this period.) A single wooden minaret was erected (and later replaced by Mimar Sinan during restorations in the 16th c.), and three additional minarets were added at a later date. The altar was shifted slightly to the right to accommodate a mihrab indicating the direction of Mecca, and an ablution fountain, along with a kitchen, was erected in the courtyard. Ayasofya was converted from a mosque into a museum by Atatürk in 1935, after a painstaking restoration led by Thomas Whitmore of the Byzantium Institute of America. Mosaics and icons that were previously defaced or whitewashed were rediscovered and restored. Excavations are continuing to reveal the foundations of the church built by Theodosius.
While this enduring symbol of Byzantium still has the power to instill awe after so many additions and reconstructions (including tombs, schools, and soup kitchens during its tour of duty as a mosque), the exterior's original architecture is marred by large and boxy buttresses; you'll get more of a representation of the intent of Justinian's original from the inside.
On your way in, notice the stone cannonballs lining the gravel path of the outer courtyard. These are the actual cannonballs used by Mehmet the Conqueror in his victorious 1453 battle for the city. The main entrance to Ayasofya leads to the exonarthex, a vaulted outer vestibule that was reserved for those not yet baptized. The inner narthex, or vestibule, glistens with Justinian's original gold mosaics embellished with floral and geometric patterns. The most central of the nine doors leading into the nave of the church, called the Imperial Gate, is topped by a mosaic of the Christ Pantocrator holding a book with the inscription "Peace be with you. I am the Light of the World." He is surrounded by roundels portraying the Virgin Mary, the angel Gabriel, and a bearded emperor, believed to represent Leo VI asking for forgiveness for his four marriages.
Through the Imperial Gate is a sight that brought both emperors and sultans to their knees: a soaring dome that rises 56m (184 ft.) in height (about 15 stories) and spans a width of approximately 31m (102 ft.). Light filters through a crown formed by 40 windows and ribs, glittering with the gold mosaic tiles that cover the entire interior of the dome. At its decorative peak (including the side aisles, semi-domes, inner walls, and upper galleries), Ayasofya's interior mosaics covered more than 4 acres of space. Eight calligraphic discs, four of which are the largest examples of calligraphy in the Islamic world, ornament the interior and bear the names of Allah and Mohammed (above the apse); the four successive caliphs, Ali, Abu Bakr, Osman, and Omar (at each of the four corners of the dome); and Ali's sons Hassan and Huseyin (in the nave).
The main nave, side aisles, apse, and semi-domes are covered with mosaics and frescoes, depicting religious and imperial motifs or floral and geometric designs. At the center of the space is a square of marble flooring called Coronation Square, believed to have been the location of the emperor's throne, the place of coronation and therefore, in the minds of the Byzantines (or at least the emperor), the center of the universe. Up in the southern gallery are some of the best mosaics in the church (restoration just recently completed; thus the additional entrance fee), including the Deesis (a composition depicting Christ, his mother, and St. John the Baptist), considered to be one of Byzantium's most striking mosaics, in spite of the missing lower two-thirds. This mosaic is one of the oldest, dating to the 14th century. Opposite the Deesis is the tomb of Henrico Dandalo, the blind Venetian doge whose success in diverting the Fourth Crusade to Constantinople resulted in his capture of the city in 1204. Along the balcony railing near the deesis is the graffiti of a 9th-century-A.D. Viking -- the equivalent to "Halvdan was here." At the far end of the gallery near the apse are two additional mosaics: one depicting Empress Zoë with her third husband, Constantine IX Monomachus, separated by a figure of Christ, and a mosaic portrait of Emperor John II Comnenus, his wife, Empress Eirene, and their son, Prince Alexius (extended onto the panel on the wall to the right).
Exit the church through the small Vestibule of Warriors in the inner narthex opposite the ramp to the upper gallery. Previously used as an entrance, this is now an exit, so you're forced to turn around to view the mosaic lunette depicting an enthroned Virgin Mother and Child, flanked by Constantine proffering a model of the city and Justinian offering a model (inaccurate) of the Ayasofya. (A mirror has been placed above the current exit to alert you to the mosaic behind you.) I Wish I May, I Wish I Might -- According to legend, when construction of the Ayasofya reached the height of a man, the construction team set out to get a bite to eat, leaving their tools under the watch of a small boy. An angel appeared and urged the boy to fetch the men so that they could return to the work of building God's house. When the boy told the angel that he promised not to leave the tools unattended, the angel promised to keep an eye on everything until his return. After leaving the site and thus breaking his promise, the boy was never allowed to return, and the angel continues to wait for him. Go to the entrance of the basilica proper, to the left of the Imperial Door; legend has it that the angel grants a wish to all those who successfully complete a 360-degree circle with their thumb in the hole of this wish-worn column