Turkey will convert the Hagia Sophia cultural site back into a functioning mosque. The millenary place of worship was turned into a museum in 1934.

The country’s top administrative court annulled Hagia Sophia’s status as a museum early on Friday morning. Shortly after, President Recep Tayyip Erdogan signed a presidential decree that transferred management of the site from the Ministry of Culture to the Diyanet, Turkey’s Directorate of Religious Affairs.

"It was concluded that the settlement deed allocated it as a mosque and its use outside this character is not possible legally,” the court ruled. “The cabinet decision in 1934 that ended its use as a mosque and defined it as a museum did not comply with laws."

People chant slogans following Turkey's Council of State's decision, outside the Byzantine-era Hagia Sophia, one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, Friday, July 10, 2020.

People chant slogans following Turkey's Council of State's decision, outside the Byzantine-era Hagia Sophia, one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, Friday, July 10, 2020. (AP Photo/Emrah Gurel)

Unesco, which has classified the structure as a World Heritage site, urged Turkey not to change the status without discussion, the BBC reported. Unesco warned that the “effective, inclusive and equitable participation of communities and other stakeholders concerned by the property is a necessary condition for the preservation of heritage and for the enhancement of its uniqueness and significance.”

People chant slogans following Turkey's Council of State's decision, outside the Byzantine-era Hagia Sophia, one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, Friday, July 10, 2020.

People chant slogans following Turkey's Council of State's decision, outside the Byzantine-era Hagia Sophia, one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, Friday, July 10, 2020. (AP Photo/Emrah Gurel)

The Hagia Sophia was originally founded as the first cathedral in the Roman Empire, but the Ottomans converted the cathedral to a mosque following the fall of Constantinople. In 1934, Turkey’s founder and national hero Mustafa Kemal Ataturk turned the mosque into a museum in accordance with the secular approach of his new government.

People chant slogans following Turkey's Council of State's decision, outside the Byzantine-era Hagia Sophia, one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, Friday, July 10, 2020.

People chant slogans following Turkey's Council of State's decision, outside the Byzantine-era Hagia Sophia, one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, Friday, July 10, 2020. (AP Photo/Emrah Gurel)

The museum has remained at the center of the struggle between the country’s conservative Muslims and its more secular elements. A portion of the museum was set aside for worship starting in 1991, but the country’s Islamists have petitioned for decades to fully revert the site to a place of worship.

Shortly after the announcement, a small crowd gathered outside the Hagia Sophia, some of them chanting “Allahu akbar,” or “God is great.”

It is not clear what rule changes would follow the conversion. Erdogan may only open the site for special occasions, as he did to mark the anniversary of the Ottoman conquest of the city, the New York Times reported. However, his fundamentalist supporters may demand freedom to enter the building for daily prayers.

The move has already drawn criticism from historic preservationists, members of the Eastern Orthodox faiths and western religious freedom advocates, according to the Independent. In addition to its historical significance, the museum has been a major draw for tourism, attracting 3.7 million visitors last year alone.

SAUDI OFFICIALS GO ON TRIAL IN ABSENTIA IN TURKEY FOR KHASHOGGI MURDER

"The nationalism displayed by President Erdogan... takes his country back six centuries," Greek Culture Minister Lina Mendoni said in a statement.

People, draped in Turkish flags, gather outside the Byzantine-era Hagia Sophia, one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, following Turkey's Council of State's decision, Friday, July 10, 2020.

People, draped in Turkish flags, gather outside the Byzantine-era Hagia Sophia, one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, following Turkey's Council of State's decision, Friday, July 10, 2020. (AP Photo/Emrah Gurel)

However, Turkey responded with strong condemnation of suggestions of discrimination, saying that converting the museum into a mosque would not exclude people of other faiths.

People visit the Byzantine-era Hagia Sophia, an UNESCO World Heritage site and one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, Friday, July 10, 2020.

People visit the Byzantine-era Hagia Sophia, an UNESCO World Heritage site and one of Istanbul's main tourist attractions in the historic Sultanahmet district of Istanbul, Friday, July 10, 2020. (AP Photo/Emrah Gurel)

"Opening up Hagia Sophia to worship doesn't keep local or foreign tourists from visiting the site," Ibrahim Kalin, Turkey's presidential spokesperson, told Anadolu Agency.

CLICK HERE TO GET THE FOX NEWS APP

U.S. Secretary of State Mike Pompeo urged the Ankara government to maintain the site as a museum.

“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 as a much-needed bridge between those of differing faith traditions and cultures,” he said in a statement.

The Associated Press contributed to this report.