Hagia Sophia is a museum, formerly Greek Orthodox church which was converted into a mosque in 1584, and located in Trabzon, in the north-eastern part of Turkey. It dates back to the thirteenth century when Trabzon was the capital of the Empire of Trebizond. It is located near the seashore and two miles west of the medieval town's limits. It is one of a few dozen Byzantine sites still extant in the area. It has been described as being "regarded as one of the finest examples of Byzantine architecture".
Hagia Sophia was built in Trebizond during the reign of Manuel I between 1238 and 1263. The oldest graffiti carved in the apses of the church contain the dates 1291 and 1293. After Mehmed II conquered the city in 1461, the church was possibly converted into a mosque and its frescos covered in whitewash. Other scholars suggest it was not converted until 1584, being spared the initial transformation because it stood several kilometers outside the city walls. The monastery next door continued to be used by monks as late as 1701, when Tournefort found them still in residence. It is likely that the monks gradually abandoned a building that failed to protect them from harassment and predation, and the Turks assumed its use without needing to expel them.