ANKARA, Turkey — Turkish President Recep Tayyip Erdogan is scheduled to join hundreds of worshippers Friday for the first Muslim prayers at the Hagia Sophia in 86 years, after a controversial high court ruling paved the way for the landmark monument to be turned back into a mosque.

A government decree reopened the “jewel” of the Byzantine Empire for Muslim worship and abolished its status as a museum. The conversion of what was once the most important church of Christendom has led to an international outcry.

The 6th century monument, which remains the main feature of the Istanbul skyline, has a history rich with symbolism.

The Byzantine era

Hagia Sophia, or the Church of Holy Wisdom, was built by the Byzantine Emperor Justinian I on the site of an destroyed basilica of the same name. Completed in 537, it was among the world’s largest domed structures and would serve as the foremost Orthodox Christian church for some 900 years. Imperial ceremonies, including the crowning of emperors, were held there. The multicolored mosaics depicting the Virgin Mary, the baby Jesus, angels and other Christian symbols along with emperors and their families that centuries of rulers installed added to its reputation as an architectural gem.

The Ottoman conquest

Ottoman sultan Mehmet the Conqueror defeated the Byzantine Empire and captured Istanbul, then known as Constantinople, in 1453. The 21-year-old immediately turned the majestic Hagia Sophia into a mosque as an emblem of Muslim triumph over the city. The structure served as an imperial mosque and subsequent sultans added minarets, a school, library and a fountain, completing its transformation into a mosque complex. The mosaics were eventually plastered over in line with iconoclasm traditions that bar the depiction of figures.

A museum for a secular Turkey

Mustafa Kemal Ataturk, the war hero who founded the Turkish Republic from the ruins of the Ottoman Empire in 1923, had Hagia Sophia made into a museum in 1934 as part of his reforms to build a secular country. Its mosaics were brought back into the open, and the structure served for years as a symbol of Istanbul’s rich multi-faith and multicultural past.

Included on the list of World Heritage sites maintained by the U.N. cultural body UNESCO, it became one of Turkey’s most-visited landmarks, drawing millions of tourists every year. However, Atakurk’s decision to cease Hagia Sophia’s use as a mosque was met with dismay by religious and nationalist groups. They had long called for the iconic building to be “freed from its chains” and converted back into a Muslim place of worship.

Restoration as a mosque

Erdogan signed a July 10 decree fulfilling their wishes soon after Turkey’s highest administrative court ruled that Istanbul’s conqueror had bequeathed the Hagia Sophia as a mosque and that the 1934 museum conversion was illegal. His government has vowed to protect the Hagia Sophia’s Christian artifacts and to keep the structure open to tourists outside of prayer hours.

The ticket kiosk outside has been removed and the interior marble floors have been covered in a turquoise-colored carpet chosen by the president himself in preparation for the first Friday prayers. Some 500 invited participants will be required to maintain social distance due to the coronavirus outbreak. The mosaics will be covered up with curtains during the prayers, officials have said.

Fulfilling an Islamist dream

For Erdogan, a pious Muslim whose ruling party has roots in Turkey’s Islamic movement, performing Friday prayers at Hagia Sophia is a dream from his youth coming true. He has described Ataturk’s decision to turn it into a museum as a “mistake” that is now being rectified.

Critics see the president’s decision as the latest move by Erdogan to distract attention from economic woes the coronavirus has only exacerbated and to shore up his conservative-religious support base. Opening up Hagia Sophia to Muslim prayers is also seen as a part of Erdogan’s efforts to deepen Turkey’s Muslim identity and to roll back his predecessor’s secular legacy.