I believe the correct answer is: a mosque.
Before Turkey’s government converted Hagia Sophia (meaning “Holy Wisdom”) into a museum in 1934, Hagia Sophia was a mosque, a place of worship for Muslims. Originally, Hagia Sophia was a Greek Orthodox Church, during the reign of Manuel I, which was converted into a mosque in 1584.