It served as a center of religious, political, and artistic life for the Byzantine world and has provided us with many useful scholarly insights into the period. It was also an important site of Muslim worship after Sultan Mehmed II conquered Constantinople in 1453 and designated the structure a mosque. Since its origins in the sixth century A.D, the Hagia Sophia has served as a church, a mosque, and, since 1934, a museum. But on July 10, the Turkish government declared that from now on it would serve as a mosque and be open for all visitors when not in use for the five daily prayers.
Hope this helped <3