It stopped being a mosque in 1931. Ataturk (the best guy to happen to Turkey since Paul) turned it into a secular museum in 1935.
I took my five teenage kids to Istanbul this spring. As we looked at numerous buildings from Roman and Byzantine times that had been converted to Islamic or Ottoman uses I drilled home the most important lesson a Westerner can learn from visiting the once great and once Christian nation of Turkey. “Don’t lose wars.” It’s a lesson Western Europe really needs to learn from quickly.
You understand of course that it was Western Crusaders who so weakened the Empire that it fell to the Turks in the 15th century. You know, when the crusaders of the 7th Crusade took The City, they set up a whore on the altar at Argia Sophia. And was Italian canoneers in service to the excersable Suleiman who bombarded The City before the final assault!