"There is no need to worry, Hagia Sophia will be guarded as it used to. We sign a protocol, which says it will be preserved as a global heritage site in compliance with international standards. Restoration works in the buildings will be accelerated. Foreign tourists will be able to attend Hagia Sophia free of charge," Ersoy told reporters at the protocol signing ceremony.
The Diyanet head, Ali Erbas, added that the Turkish government expects an increased flow of visitors to Hagia Sophia.
"Hagia Sophia is a heritage of the entire humanity, it is one of the best historical and cultural sites, and we feel honoured to preserve it. I believe that the number of people coming there both for prayer and for a visit will grow to millions," Erbas said.
On 10 July, Turkey's top administrative court, the Council of State, annulled a 1934 cabinet decree converting Hagia Sophia into a museum, which means that it can now be used as a mosque. Turkish President Recep Tayyip Erdogan immediately signed a relevant decree.
The building, initially constructed as a Byzantine cathedral, is expected to open for Muslim prayers on 24 July.
The ruling has been met with firm resistance from many members of the international community. The Russian Orthodox Church has expressed its regret that Ankara ignored calls to preserve the site as a museum, while both Washington and Athens have also criticised the decision.
Hagia Sophia was converted into a mosque in 1453, but in 1934 it became a museum under a Turkish cabinet decree, and in 1985 UNESCO added the building to its list of World Heritage Sites.