The move is not about creating more space for prayer as Istanbul has more than 3,000 mosques.
Rather, the decision reflects President Erdogan's devotion to Islam and its overall objective of a worldwide caliphate.
Historians have expressed concerns about the safety of the building's religious icons such as images of Madonna, mother of Christ, and other saints on the walls
Turkey is overwhelmingly Muslim and this move to reclaim Hagia Sophia as a mosque is seen as a bid to boost Mr Erdogan's AK Party's sliding popularity polls.
The move may prove popular with Mr Erdogan's conservative supporters and nationalists but church leaders have argued Hagia Sophia was Christian for nearly 900 years and Muslim for only 500 years.
Its 30m (98ft) dome, framed by four minarets, dominates Istanbul's skyline.
During President Erdogan's time in office mosques have sprung up in some of Istanbul's most important sites.
A newly-constructed mosque now towers over the secular monument in Taksim square.
As the mosque was being built, the city's opera house was demolished - a symbol of the Ataturk era.
Hagia Sophia could be open for prayers as early as 15 July - the date of the attempted coup in Turkey four years ago and now a national holiday.