It was a basilica-planned patriarchal cathedral built by Byzantine Emperor Justinianus I between 532-537 in the old city center of Istanbul. After the conquest of Istanbul by the Ottomans in 1453, it was converted into a mosque by Mehmed II. It was taken under renovation with a decree issued by Atatürk in 1934, and in 1935, with the decision of the Council of Ministers, it was converted into a museum, excavation and renovation work was started, and it served as a museum from 1935 to 2020. It was converted back into a mosque in 2020. In 2024, the upper floor of the mosque began to serve as a paid museum. Thus, the lower floor of Hagia Sophia became a mosque and the upper floor became a museum.