Hagia Sophia became a mosque once again and the first prayer after 86 years is performed in July 24, 2020 on Friday, “The Turkish people had to wait until July 10, 2020, for permission to pray at the Hagia Sophia... President Recep Tayyip Erdoğan proceeded to issue a decree minutes later to announce that the Presidency of Religious Affairs (Diyanet) would manage the Hagia Sophia, which would open its doors to worshippers.” 
The structure that stands today was actually the third church to be built on this site. The first two (built in 360 and 415 respectively) were both razed to the ground in troubled Byzantine times. The third and the final church was built in 537. Mehmet the Conqueror declared the Hagia Sophia a mosque following the conquest of Constantinople in 1453, and prayed there the next Friday. The most important reason for the conquest of Istanbul to stand out from other Islamic conquests is the hadith on the conqueror of Constantinople:
لَتُفْتَحَنَّ الْقُسْطَنْطِينِيَّةُ، فَلَنِعْمَ الْأَمِيرُ أَمِيرُهَا، وَلَنِعْمَ الْجَيْشُ ذَلِكَ الْجَيْشُ
"Verily you shall conquer Constantinople. What a wonderful leader will he be, and what a wonderful army will that army be!" 
As a mosque, Hagia Sophia was considered as one of the holiest Islamic temples of the world. It also served as Istanbul's principal mosque for nearly 500 years and was used as a model for many others including the Sultan Ahmet Mosque, the Suleymaniye Mosque and the Rustem Pasha Mosque.
The Great Hagia Sophia Mosque today, “… was closed off to the public after the restoration works started in the 1930s. Then it was turned into a museum with a Cabinet Decree dated November 24, 1934. [In 1935, it was reopened as with a museum status.] The Council of State reversed the Cabinet Decree in question on July 10, 2020. The Hagia Sophia Mosque was reopened to worship with the Presidential Decree No. 2729 signed by President Recep Tayyip Erdoğan and promulgated immediately after.”
The Great Hagia Sophia Mosque is still open to touristic visits. The visitors will not pay a fee as before since entrance to all the great mosques in Istanbul, such as Blue Mosque and Suleymaniye Mosque are free of charge. The mosaics and iconographies can still be seen.
For further information:
- https://ayasofyacamii.gov.tr/en / | Hagia Sophia Mosque
- UNESCO World Heritage Centre | Historic Areas of Istanbul
- https://www.trtworld.com/magazine/hagia-sophia-friday-prayer-full-transcript-of-the-sermon-38377 | Hagia Sophia Friday prayer: Full transcript of the sermon
- https://ayasofyacamii.gov.tr/Pdf/Ayasofya_Camii_EN.pdf | TR Directorate Of Communications
 Yahya Bostan, “Why did Hagia Sophia open to worship?”, https://www.dailysabah.com/opinion/columns/why-did-hagia-sophia-open-to-worship
 Ahmad, al-Musnad, 331; al-Hakim, al-Mustadrak, 421-422; al-Tabarani, al-Mu`jam al-Kabir, 38; al-Haythami,218-219; Bukhari, al-Tarikh al-Kabir, 81 and al-Saghir 1:306.
 T.R. Directorate of Communications, Hagia Sophia Mosque, https://ayasofyacamii.gov.tr