Several thousand Muslims – along with Turkish President Recep Tayyip Erdogan – gathered on Friday to take part in the first prayer at Hagia Sophia since the Istanbul landmark was reconverted to a mosque.

Despite the coronavirus pandemic, tight crowds formed on Friday morning around the mosque for the prayer around 1000 GMT. Several people had spent the night in the area.

The UNESCO World Heritage site in historic Istanbul was first built as a cathedral in the Christian Byzantine Empire but was converted into a mosque after the Ottoman conquest of Constantinople in 1453.

The Council of State, the highest administrative court, on July 10 unanimously cancelled a 1934 decision by modern Turkey’s founder Mustafa Kemal Ataturk to turn it into a museum, saying it was registered as a mosque in its property deeds.

Erdogan then ordered the building to reopen for Muslim worship. There were Koranic recitations in the morning in Hagia Sophia before and during the Friday prayer which Erdogan, Turkish officials and foreign dignitaries attended. Up to 1,000 people prayed inside the building and many outside. Istanbul Governor Ali Yerlikaya said the spaces around Hagia Sophia were swiftly filled. The timing of the first prayer is significant.

Friday is the 97th anniversary of the Treaty of Lausanne, which set modern Turkey’s borders after years of conflict with Greece and Western powers. Erdogan, who professes nostalgia for the Ottoman empire, has called for the treaty’s revision in recent years.

In Turkey, Hagia Sophia remains closely associated with the Ottoman conquest of Constantinople by Sultan Mehmet II, known as the Conqueror. An Ottoman military band was in the building’s forecourt on Friday. Erdogan shared a video on Twitter on Wednesday which featured Muslims from across the Islamic world singing in tribute to Hagia Sophia.

"You have always been ours, and we are yours," the Turkish leader wrote. Around 3.8 million tourists visited Hagia Sophia last year.