Regular religious services have not been held there since 1934 when modern Turkey's founding president Mustafa Kemal Atatürk signed an order converting the building into a museum. But a legal challenge claims the signature was forged.
A Turkish court will rule in the next 15 days on whether the government is permitted to revert the world-famous Hagia Sophia Museum into a mosque.
The vast domed building in Istanbul, today a major tourist attraction, is now at the centre of an international row after President Recep Tayyip Erdoğan said Muslim worship should take place on the site again.
Regular religious services have not been held there since 1934 when modern Turkey's founding president Mustafa Kemal Atatürk signed an order converting the building into a museum.
But a legal challenge launched on Thursday alleges Atatürk's signature on that order may have been forged.
The Turkish newspaper Sözcü quoted one lawyer as telling the court that the building was the personal property of Mehmed II, the Ottoman sultan whose forces captured the city then known as Constantinople in 1453.
The lawsuit was launched by a Turkish religious association that has long challenged Hagia Sophia's status as a museum.
If the court agrees, the 1934 order will be annulled and it will be left to Erdoğan to decide whether he wants to permit religious services in the building once again.
It has until July 16 to issue a ruling, although a decision may come earlier.
But analysts say there is little local demand for the Hagia Sophia to become a mosque again, citing the vast Blue Mosque situated across the street that can accommodate up to 10,000 worshippers.
Instead, it is seen as a move to placate Erdoğan's core voter base — which is conservative, pious and shrinking.
"I think he feels the pressure of popular support dwindling and therefore he wants to use issues that he hopes will remobilise his right-wing base around nativist, populist, anti-elitist topics, [so] enter Hagia Sophia," said Soner Cagaptay, director of the Turkey Research Programme at the Washington Institute.
"So it's not about prayer space, it's not about building a mosque or providing for a mosque for one that does not exist."
President Erdoğan has certainly sought to portray the Hagia Sophia as a national matter, saying it is for the Turkish nation to decide if the Koran should be recited there.
He has also rebuked Greece for expressing concern about the proposed conversion.
Earlier this week US Secretary of State Mike Pompeo intervened in the debate, urging Turkey to keep 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 humanity as a much-needed bridge between those of differing faith traditions and cultures," Pompeo said in a statement on Wednesday.
The Hagia Sophia was built as a cathedral in 537 CE and remains an icon of the Eastern Orthodox Church. Its vast dome was the world's largest enclosed space for the centuries.
It became a mosque after the Ottoman capture of the city in 1453, when wall paintings depicting Christian imagery were covered in white plaster because of the Muslim ban on iconography. Minarets were added to the side of the dome in the years that followed.
After the building became a museum, the Christian wall paintings were unveiled once more while the more recent Islamic calligraphy was retained.