The Agia Sofia (Holy Wisdom) in Thessaloniki, Greece, is one of the oldest churches in that city still standing today. It is one of several monuments in Thessaloniki included as a World Heritage Site on the UNESCO list.
Since the 3rd century, there was a church in the location of the current Agia Sofia. In the 8th century, the present structure was erected, based on the Agia Sofia in Constantinople (present-day Istanbul, Turkey). In 1205, when the Fourth Crusade captured the city, the Hagia Sophia was converted into the cathedral of Thessaloniki, which it remained after the city was returned to the Byzantine Empire in 1246. After the capture of Thessaloniki by the Ottoman Sultan Murad II on 29 March 1430, the church was converted into a mosque. It was reconverted to a church upon the liberation of Thessaloniki in 1912.
Its ground plan is that of a domed Greek cross basilica. Together with the Gül and the Kalenderhane Mosques in Istanbul and the destroyed Church of the Dormition in Nicaea, it represents one of the main architectural examples of this type, typical of the Byzantine middle period.
In the Iconoclastic era, the apse of the church was embellished with plain gold mosaics with only one great cross, similarly to the Hagia Irene in Constantinople and the Church of the Dormition in Nicaea. The cross was substituted with the image of the Theotokos (God-bearer, or Mary) in 787-797 after the victory of the Iconodules. The mosaic in the dome now represents the Ascension with the inscription from Acts 1:11 "Ye men of Galilee, why stand ye gazing up into heaven?". The dome is ringed by the figures of all Twelve Apostles, Mary and two angels.
Between 1907 and 1909 byzantine historian Charles Diehl restorated the whole building that underwent many damages during a fire in 1890. Much of the interior decoration was plastered over after the Great Thessaloniki Fire of 1917. The dome was not restored until 1980.