The current Hagia Sophia was commissioned by Emperor Justinian I after the previous one was destroyed in the Nika riots of 532. It was converted into a mosque in 1453 when the Ottoman Empire commenced and was a museum from 1935 to 2020.