Turkish President Recep Tayyip Erdogan on Friday legally changed the status of Istanbul's Hagia Sophia museum to a mosque.
Erdogan's announcement came shortly after the country's highest court, the Council of State, revoked a 1934 cabinet decision that turned the edifice into a museum.
Administration of the building is to be turned over to the country's religious authority, the Diyanet, Erdogan said, adding that he will address the nation on the issue shortly before 21.00 local time on Friday evening.
The Council of State ruled in favour of a religious association that has long challenged Hagia Sophia's status as a museum, arguing the building was the personal property of Mehmed II, the Ottoman sultan whose forces captured the city then known as Constantinople in 1453.
Erdogan's drive to turn the monument — which previously was an Orthodox Christian cathedral and a mosque — back into a Muslim house of worship was seen by many as a move to placate his core voter base and drew international criticism.
Hagia Sofia is a UNESCO World Heritage Site and part of the "Historic Areas of Istanbul" property which entails "a number of legal commitments and obligations," the UN agency warned on Friday ahead of the ruling.
"Thus, a State must ensure that no modification is made to the outstanding universal value of the property inscribed on its territory. Any modification requires prior notification by the State concerned to UNESCO and then, if necessary, examination by the World Heritage Committee," it added.
The US top diplomat, Mike Pompeo, urged the government to keep the site as a museum earlier this month.
"The United States views a change in the status of the Hagia Sophia as diminishing the legacy of this remarkable building and its unsurpassed ability — so rare in the modern world — to serve humanity as a much-needed bridge between those of differing faith traditions and cultures," Mike Pompeo said in a statement.
The Russian Orthodox Church said on Friday that it regretted Turkey's decision to convert the museum into a mosque.
"Ths decision, alas, is not aimed at reconciling existing differences, but, on the contrary, can lead to even greater divisions," a spokesperson told the TASS news agency.
The Hagia Sophia was built as a cathedral in 537 AD and remains an icon of the Eastern Orthodox Church. Its vast dome was the world's largest enclosed space for the centuries.
It became a mosque after the Ottoman capture of the city in 1453, when wall paintings depicting Christian imagery were covered in white plaster because of the Muslim ban on iconography. Minarets were added to the side of the dome in the years that followed.
After the building became a museum, the Christian wall paintings were unveiled once more while the more recent Islamic calligraphy was retained.