The first prayer is held in the Hagia Sophia in Istanbul

The Turkish President recently restored the status of a mosque to a building that had long been a Christian Shrine.

Thousands of Muslims on Friday went to the famous Hagia Sophia in Istanbul to take part in the first prayer after the building returned to the status of a mosque.

Dozens of believers broke through one of the checkpoints and rushed to the temple, which was built in 537 and has long been one of the leading Christian cathedrals in the world.

Later on Friday, Turkish President Recep Tayyip Erdogan and about 500 other officials attended the prayer.

Erdogan issued a decree to restore the building to mosque status earlier this month, shortly after the Turkish Supreme Court ruled that Hagia Sophia was illegally turned into a Museum more than eight decades ago.

This move caused discontent in Greece, the United States, and among Christian churches, which called on Erdogan to preserve the building’s Museum status.

Pope Francis said Turkey’s decision saddened him.