The first structure considered to be the precursor of today’s Hagia Sophia was shaped as balisica and was called “Great Church”. It was completed by Emperor Constantine (337-361) around in 360 at the place where the Basilica Cistern is located today. This structure was destroyed as a result of growing tension between Patriarch Ioannes Chrysostomos II and Empress Eudokia. Instead of that structure, a new church was completed in 415 during the reign of Emperor Theodosius II (408-450) at the place where Hagia Sophia is located today. This structure was started to be called “Hagia Sophia”, which meant “Holy Wisdom” of God, starting from the year 430. This structure was also demolished during the Nika Revolt which started against Emperor Justinian I in January 532. The same emperor appointed Anthemius from Tralles and Isidoros from Miletus as architects for the construction of the building. The construction was completed five years later and it was opened on 27 December 537.
In the 1930s, the Council of Ministers decided to convert the place into a museum and gave permission to the German Archaeological Institute to do scientific work in and around Hagia Sophia. Alfons Maria Schneider, who conducted research there on behalf of the Institute, aimed especially at finding the forecourt and the monumental fountain that belonged to the earlier periods of Hagia Sophia. As a result of this study, the entry-level that was completed in 415 and some architectural pieces were found in their original places but had been used as filler material. That early structure, known to be in the shape of a basilica with a double-pleated wooden roof, was a similar shape to its precessor nearby. Among the pieces found, the most interesting piece was a total of twelve sheep, ten of which were found in the area known as Schneider’s Opening and two of which were found next to the trees by the cafeteria. Because Jesus the Christ was referred to as “good shepherd”, those sheep pointed to his twelve apostles. In the ground, the steps and bases of the columns that ensured the entrance of the building can be seen. The other architectural decoration pieces that belonged to the period of Theodosius II are located in the northern part of the cafeteria across from the excavation area.
During excavation works conducted by the Museum Directorate towards the end of the 1950s, a house shaped burial chamber was discovered on the northwestern side of the garden approximately 5m beneath the present ground level. As in other examples, this burial chamber that remained unidentified because there was no decoration or markings, comprised of graves placed on shelves on the front of the chamber wall. This 5th century burial chamber was not a structure connected with the second Hagia Sophia. During these excavation works, a Turkish period fountain was discovered next to the western entrance deep below ground level. A sunken fountain (çukur çeşme) of which there was no knowledge until recently, and that used the same supply as this fountain was also discovered during ground renovation works two years earlier in the area in front of the museum’s entrance gate of the present.
The round domed structure to the northeast corner of the Hagia Sophia from the Theodosius II period was the treasury building. Treasury buildings in churches were not only used to keep objects valuable in material terms, but also objects that bore religious value such as remnants of the saints. The baking area known to exist in the Hagia Sophia treasury building from sources also bears great importance as this was where the bread distributed to the congregation after religious services was baked. This was used as a storeroom for the soup kitchen known to have been established in accordance with the Fatih Sultan Mehmet Endowment.
After the destruction of the second Hagia Sophia, the third Hagia Sophia which was constructed in the same location was built upon this after the site of the architectural remains of the old structure was leveled. Due to this, the building was moved slightly towards the west. According to some researchers, the four support buttresses, believed to be built to reduce the impact of earthquakes in this section were built in either the 10th or 14th centuries, while others claim these were built in 1207 by the forces of the Fourth Crusade who invaded the city in 1204. There was also a bell tower on the second and third buttresses. As a protective measure against earthquakes, two long support walls were added to the existing northern and southern buttresses by Mimar Sinan in the 16th century.
There was an inscription on the southern section of the Hagia Sophia’s outer narthex. A copy of the original inscription which was used upside down on the cornice at the entrance section of Sultan Suleyman’s Tomb was made and hung where it was originally positioned in Hagia Sofia. The inscription is regarding a church decree dated 1166. There is a mosaic tughra (signature of the sultan) on the south side of the middle gate leading from the outer narthex to the inner narthex. During restoration works conducted by Swiss architect Fossati between 1847-1849, Sultan Abdulmecid asked the architect to do his portrait from the broken mosaic pieces, however, it was later decided that it would be more suitable to make the sultan’s tughra (signature) from the mosaic pieces. As this is the only tughra of an Ottoman sultan to be made of Byzantine mosaics in the world, it bears great significance.
The large gate in the center leading to the main section after passing through the outer and inner narthexes of the Hagia Sophia is known as the “Imperial Gate.” This gate was only used by high ranked religious officials and members of the sultan’s family. The worn areas on the ground beneath the side walls at two points when entering the gate, was due to the icons known to be hung there. There were icons of Mary on the right and the Prophet Jesus on the left of the entrance. The icon known as “Odighitria-Mary the Guide” was paraded around the city on Fridays. It would also be paraded during the time of epidemics or attacks to protect the city. The floor became worn due to those who came to touch these icons throughout the centuries due to the belief of their miraculous powers.
The deep purple colored stone, particularly valued due to its rareness began to be used in structures of major importance in the Roman Empire when it was discovered in Central Egypt in 14 AD. This stone known as porphyry was later used in the tombs of the members of the imperial family. Columns of various colors and materials were used in the Hagia Sophia both to save time and money, but there were eight porphyry columns situated on the corners to emphasize the importance of the structure.
In an attempt of reducing the weight of the huge dome covering the main section of the building, light bricks mixed with volcanic ash were used in the construction, and weight distribution of the dome was procured with semi-domes. Pendentives of a dimension which was never used in any structures before were built to fill the spaces that appeared on the entrance to the main area of the dome. When the dome collapsed in an earthquake in 558, almost twenty years after the completion of the construction, Isidore, nephew of the architect Isidore was commissioned to reconstruct the dome, and this dome which was 7m higher than the previous was completed on 24 December 562. The highest point of the dome which is almost 31m in diameter is approximately 56m. There were forty windows encircling the dome, four of these were later sealed. The interior area that is almost a square is 78x72m. The structure underwent repairs following the major earthquakes of the 9th, 10th, 14th and 19th centuries. Basically, the dome which was repaired many times after the construction in 537 took its existing form in 562. Four of the forty windows on the dome were sealed during these repairs. The mosaics inside the Hagia Sophia indicate different periods varying from between the 6th and 14th centuries. On the other hand, there is an inscription of surah An-Nur from the Qur’an on the inside of the dome. On the northeastern corner, the face of the six winged seraphim angel found on each corner and which is believed to carry the throne of the Prophet Jesus on the Day of Judgement was revealed during repairs in 2009. While the four depictions were originally made of mosaic, the angels on the western side were not repaired with mosaic in the Byzantine period, but frescoes of the angels were done instead. During repairs conducted in the middle of the 19th century, the faces of the mosaic angels on the eastern side were covered with metal. The faces of the other angels beneath the star shaped metal plates were still intact. Although it is known that there were mosaic decorations- some of which are still present today- when the construction was completed, sources of that period mention no images of humans or angels. Those which had human or angel depictions are known to have been done in later centuries, after the “iconoclasm” movement ended in 843. Only the faces of the mosaic depictions in the building were covered. After Swedish King Charles’ (Karl) defeat in the Battle of Poltava with the Russians, he took refuge in the Ottoman Empire and allowed Cornelius Loos, one of his men, to visit and measure the structures, and also draw pictures. As a result, from Loos’ representations it is clear that the mosaic depictions in the Hagia Sophia were not covered. These mosaics were completely covered with plaster after 1750. During repair works in 2009, the face of the seraphim depiction that was covered in the course of repairs conducted by Fossati in the middle of the 19th century was discovered on the northeastern pendentive. It is known that there is an identical face almost 1.8m long made from mosaic on the southeastern pendentive. On the other hand, it is also known that the faces of the seraphim portrayals on the northwest and southwest were frescoes rather than mosaic. During the “iconoclasm” movement which continued from 726-843, the mosaic images of humans and angels were destroyed, and these were replaced by geometric decorations and in particular cross designs. As in this case, this practice generally done by painting over mosaics that existed on the ceilings, occasionally manifested in the form of crosses made of mosaic.
During the 19th century repair works, some of the mosaics on the upper floor of the structure were revealed in the process of cleaning. The most important among these were the mosaics of the patriarchs Ignatios, Ioannes Khrysostomos and the Young Ignatios lined up on the northern tympanum wall towards the west on the top floor.
In the southeastern part of the main area there was a crowning section. This practice became mandatory for the first time in 457 after a Byzantine emperor was crowned by the patriarch. The crowning/coronation area decorated with colored stone and twelve marble circles representing the twelve apostles of the Prophet Jesus dates back to the 11th century. The coronation area is situated in the south between the wall and column. Traces of where the throne passed are still visible on the ground. While the emperor sat on one side of the Byzantine throne consisting of two parts, on the other was the bible representing the Prophet Jesus who was believed to have granted the emperor authority to rule.
A ramp was constructed on each corner of the building to gain easy access to the upper gallery, but the ramp in the southeastern corner collapsed at the beginning of the 10th century. The ramps were used by imperial women and those permitted to go to the upper gallery, and the northern section of the upper floor was known to be used by students of Christianity. There is also a tomb, in particular in the northeastern ramp which has been covered in marble slabs since it was constructed.
The section bordered by lines of stone on the floor of the western part of the Hagia Sophia’s upper gallery facing the apse was made for the wives of high ranking state officials and the empress to stand during religious services. The area towards the east where there is a round is believed to be where the empress stood during these services. Those present that people would not stand throughout the entire service in the Byzantine Church.
At the end of the 10th century, large decorated wooden beams and columns were placed between the walls where the imperial women stood to reduce the movement of the structure during earthquakes. Monograms bearing the initials of Emperor Iustinianos (Justinian) I and his wife Theodora are in the center of the columns capitals throughout the entire building. While almost all of the columns were brought from other buildings, the crowns of these columns were made for this structure.
There was a direct entrance from the structure known to exist along the southern side of the Hagia Sophia that was demolished in the 10th century to the eastern section of the Hagia Sophia. In specific times of the year, the emperor and patriarch would meet in this section that was a large ceremonial hall used for the election of patriarchs, and where important religious issues were discussed. The ramp in the southeast where the patriarchate ended, which provided access to the Byzantine “Grand Palace”, was destroyed with the abolishment of the patriarchate. The entrance to the direct passage from the patriarchate building to the Hagia Sophia, was located at this point in the Hagia Sophia. The public were not allowed beyond this point, as behind this door was where the high ranked priests, the patriarch and emperor met to discuss and dispute various issues. This area classified to be special due to the sacredness of the priests and religious officials, was commonly known as the Gate of Heaven. The only section of the patriarchate that survived to the present is the secretarial chamber on the southwestern side. In view of the mosaics above the entrance door and on the ceiling, this section is believed to be the place where the emperor and patriarch held meetings. Today, this is where the icons brought from other cities are stored.
As we discover from sources, the Hagia Sophia had two baptisteries. The one on the southern side was known as the “Grand Baptistery.” The baptistery which lost functionality following the conquest in 1453 was used as an oil storage for the oil used in lanterns, this was also the burial place of Sultan Mustafa I who died in 1639. In the following period, Sultan Ibrahim who died in 1648 was also buried here. The huge baptism pool made from a single slab of marble which is the largest baptism pool in Turkey, and possibly one of largest in the world is situated outside the baptistery.
On command of Sultan Mehmed II, the Hagia Sophia was converted into a mosque following the conquest of Istanbul in 1453.
Initially, the madrasa in the northwest of the Hagia Sophia built by Sultan Mehmed II, began teaching in the place used for teaching by the priests before the church was converted. This madrasa, which was in a state of ruin by the end of the 16th century, was restored in the western style by the Fossati brothers who conducted repairs on the Hagia Sophia between the years 1846-1849. This two story madrasa, which accommodated up to ninety students continued to operate until 1924, the ruined structure was eventually demolished in 1935.
After the conquest, Sultan Mehmed II commissioned the construction of a wooden minaret on the weight tower beside the semi-dome on the western side of the building. Because it signifies the 15th century due to its style, the first brick minaret was built during the period of Sultan Mehmed II or the period of his son Bayezid II. The minaret in the southeast of the Hagia Sophia was built in the 16th century, while those in the northeast and northwest are from the 17th century. Signs of the 19th century repairs and decorations appear on the upper section of the minarets above balcony level. The height of the earliest brick minaret that was shorter than the others was extended during the process of these repairs.
In addition to other structures, a fountain was also added to the south of the building by Sultan Mahmud I in 1740/1741. This fountain was designed of a monumental dimension because the entrance of the structure was from the south during the Ottoman period.
While certain baroque style decorations appeared above the fountain with the influence of the west from the time it was constructed, there is also the inscription of surah An-Anbiya of the Qur’an over the fountain. There are also two twelve verse poems encircling the inside of the fountain. There was a school built next to the fountain for the children of the mosque officials. Although this was allocated to the imam in the early years of the Republic, it was used as an office for a while after the Hagia Sophia was converted into a museum. At the present, the ground floor is still used as an office and on the upper floor is the administrators lodge. Opposite the elementary school there was the timekeeping building in which the clocks used to define the prayer times in the mosque were kept. This structure was built by the Swiss Fossati brothers in 1853 after the completion of the major restoration they conducted on the Hagia Sophia. This building was used as an office after the Hagia Sophia was converted into a museum.
After the tombs of Sultan Selim II, Murad III, Mehmed III and the sons of Murad III were constructed in the garden situated to the southeast of the Hagia Sophia, this area was transformed into an imperial graveyard towards the end of the 16th century and beginning of the 17th century. Originally, the building of the baptistery and the tombs of the 17th century sultans Mustafa I and Sultan Ibrahim were located in this garden. 16th century Iznik ceramics were used to decorate the inside of the tombs.
The apse that existed when this was a church facing towards the east, and the mihrab of the present being slightly directed towards the south as this did not point towards the kiblah which was a necessity for worship after it was converted into a mosque, was a part of the restoration by Fossati in the middle of the 19th century. Behind this was possibly a plainer mihrab from an earlier period. The two large candlesticks brought from the main church of the city when Buda, one of the two cities constituting the present day city of Budapest, was conquered during the period of Sultan Suleyman, decorate the two sides of the mihrab. In the old apse, there is a single band of ceramic bearing the 225th verse of Al-Baqarah (Ayat al-Kursi). The worn sections of this 16th century masterpiece were restored using paint. There are 17th century ceramic panels on the wall of the vaulted area to the south of the mihrab. While one of these represents the grave of the Prophet Muhammad, the other depicts the kabah. One section from the middle of the ceramic depicting the kabah was stolen and this was replaced by a flower decorated ceramic of no relevance. The muezzin’s mahfil (a special raised platform) and mihrab were made according to the classic Ottoman style during repairs in the 16th century.
The circular panels in the building are known to be the largest calligraphy panels in the Islamic world. On these panels written by Kazasker Mustafa Izzet Efendi and placed in the walls during repairs in the 19th century it writes Allah on the southeastern side, Muhammad on the northeast, the names of the four caliphs Hz Abubakr, Omar, Osman and Ali in each of the corners, and the names of the Prophet Muhammad’s grandsons, Hasan and Husain on the two in the western side.
On the southeastern section of the building there was a library built in 1740 by Sultan Mahmud I. The manuscripts and calligraphy works totaling almost four thousand known to be kept in the library since the time it was built were preserved here until 1968 and later transferred to the Süleymaniye Library. Among these there were Iznik, Kütahya and Palace of the Porphyrogenitus ceramics, and also pieces of the Italian Faenza ceramics.
On the northeastern section of the building there was a sultan’s mahfil (platform) constructed as a separate place for the sultans to perform worship. Although this 16th century platform was originally decorated with ceramics, during the 19th century repairs it was expanded and restructured in accordance with the style of that period. There was a separate entrance to the mahfil and resting section before entering the section of worship.
The Hagia Sophia, which was subjected to extensive restoration during the process of some repairs of the Turkish period, was initially a church when it was first constructed, then converted into a mosque after the conquest. It functioned as a museum between 1930 and 2020. It has continued to function as a mosque since 24 July 2020.