Originally called Hagia Sophia (Church of Divine Wisdom), Aya Sofya sits 4km west of Trabzon's centre on a terrace close to the sea. Built between 1238 and 1263, it was influenced by Georgian and Seljuk design, although the wall paintings and mosaic floors follow the prevailing Constantinople style of the time. It was converted to a mosque after Ottoman conquest in 1461, and later used as an ammunition-storage depot and hospital by the Russians, before restoration in the 1960s.
In 2013 local religious authorities gained control of the building and converted it into a mosque again. A local judge has ruled the transformation of the former church to be illegal and ordered it to be maintained as a museum. For the moment it is both, though some of the ceiling frescoes and floor mosaics have been covered.
The church has a cross-in-square plan, topped by a single dome, showing Georgian influence. A stone frieze on the south porch depicts the expulsion of Adam and Eve from the Garden of Eden. On the western side of the building, the vaulted narthex has the best-preserved frescoes of various biblical themes, and the facade has a relief of an eagle, symbol of the church's founders, the Comnenus family. Unfortunately, most of the frescoes within arm's reach have been heavily defaced. The best frescoes (Annunciation, Visitation, Doubting Thomas etc) are in the main apse. The astonishing Christ Pantocrator on the ceiling dome is now covered with a tarpaulin, but can be glimpsed from the eastern transept.
The museum stands in gardens with a square bell tower erected in 1427, and the marble remains of a 2nd-century Roman temple unearthed in 1997. The garden cafe here is reputed to serve the best kuymak and kaygana (local herb omelette) in Trabzon.
Signposted uphill from the coastal highway, Aya Sofya can be reached by dolmuş (₺1.75) from near the southeastern end of Atatürk Alanı. A taxi costs about ₺15.