(CNN)Turkish president Recep Tayyip Erdogan has ordered the conversion of the city's historic Hagia Sophia back into a mosque after a court annulled a 1934 presidential decree that made it a museum.
Shortly after Turkey's top administrative court released its long-anticipated decision, Erdogan issued a presidential decree transferring the management of the site from the Ministry of Culture to the Presidency of Religious Affairs, paving the way for its conversion. Erdogan has been a major proponent of the move.
The Turkish leader used a televised speech Friday to urge people to respect the decision.
The Hagia Sophia will open for Friday prayers on July 24, Erdogan said.
"Since its status as a museum is changed, we are canceling the entrance fees," he said.
"Like all our mosques, its doors will be open to everyone -- Muslim or non- Muslim. As the world's common heritage, Hagia Sophia with its new status will keep on embracing everyone in a more sincere way."
"We will be treating every opinion voiced on the international stage with respect. But the way Hagia Sophia's will be used falls under Turkey's sovereign rights. We deem every move that goes beyond voicing an opinion a violation of our sovereignty," Erdogan said.
Ibrahim Kalin, Turkey's presidential spokesperson, told the country's Anadolu news agency that the building would always play a part in the world's heritage.
"Opening up Hagia Sophia to worship doesn't keep local or foreign tourists from visiting the site," Kalin said.
"So a loss from the world's heritage is not in question," he added.
Kalin said Turkey would preserve the Christian icons in the building.
Greece's culture minister decried the move earlier on Friday, calling it "an open provocation to the entire civilized world."
The Hagia Sophia was the Roman Empire's first Christian cathedral and is among the best-known Byzantine structures in the world. It switched from a Greek Orthodox cathedral to a mosque in 1453, when the Ottomans conquered Constantinople and renamed the city Istanbul.
The historic site then became a museum in 1935 as part of a decree by modern Turkey's secularist founding father Mustafa Kemal Ataturk. The building is a UNESCO World Heritage site.
Erdogan has positioned himself as a friend of conservative Islamists in Turkey, moving the country further from those secularist roots.
İsmail Kandemir, head of the Association for the Service of the Historical Foundations and the Environment, said after the hearing that "using Hagia Sophia as a museum hurts conscience of people," according to Turkish news agency Anadolu.
The association filed a lawsuit to the Council of State in 2005 calling for the site to return to being a mosque, but it was rejected in 2008, according to Anadolu.
It filed another lawsuit in 2016 saying freedom of religion had been violated but the Supreme Court rejected the case in 2018, Anadolu reported.
UNESCO said it "deeply regrets" Turkey's decision and that the choice was made without the organization receiving prior notification.
"Hagia Sophia is an architectural masterpiece and a unique testimony to interactions between Europe and Asia over the centuries. Its status as a museum reflects the universal nature of its heritage, and makes it a powerful symbol for dialogue," said UNESCO Director-General Audrey Azoulay.
UNESCO member states are obligated to ensure that any modifications to sites on the World Heritage List do not affect their outstanding value, according to the organization.
"It is important to avoid any implementing measure, without prior discussion with UNESCO, that would affect physical access to the site, the structure of the buildings, the site's moveable property, or the site's management," said Ernesto Ottone, UNESCO's assistant director-general for culture.
Erdogan has expressed annoyance at international opposition to the plan, led by neighbor Greece. "They say 'don't convert Aya Sofya into a mosque,'" he said in an interview with state broadcaster TRT on July 5. "Are you ruling Turkey or us? Turkey has institutions. If that step [is] to be taken It is obvious who has authority to do that."
Many analysts say Erdogan's move could be intended to consolidate his voters as the country deals with a shrinking economy and rising unemployment. Turkish-Greek relations are also tense due to geopolitical tensions in the Eastern Mediterranean, including the long-running dispute over Cyprus and around migrants crossing the border between the countries.
In a statement released Wednesday, US Secretary of State Mike Pompeo urged Turkey to maintain the UNESCO World Heritage Site "as an exemplar of its commitment to respect the faith traditions and diverse history that contributed to the Republic of Turkey, and to ensure it remains accessible to all."
He said the site's museum status had enabled people from all over the world to see a "magnificent achievement."
"This extraordinary site is a testament to religious expression and to artistic and technical genius, reflected in its rich and complex 1,500-year history," he said.
"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."
A spokesman for Turkey's Ministry of Foreign Affairs said it was "astonished" by Pompeo's statement.
Hami Aksoy said that Turkey guaranteed "freedom of religion and belief" for its citizens and protected "all cultural properties that we own without any distinction, including Hagia Sophia, within the framework of the tradition of tolerance stemming from our culture and history."
"Turkey has been delicately cherishing the historical, cultural and spiritual value of Hagia Sophia since its conquest," he said.
"On this occasion, we remind once again a reality that we have to repeat constantly. The Hagia Sophia is the property of Turkey, like all our cultural assets located on our land.
"Every kind of power disposition regarding Hagia Sophia is also an issue concerning our internal affairs within Turkey's sovereignty rights.
"Naturally, everyone is free to express their own opinion. However, it oversteps the mark to talk about our sovereignty rights using a language of 'warning and imposition.'"