The future of a site that has sparked thousands of deaths in inter-religious violence is set to be decided in coming weeks after India's top court wrapped up hearings in one of the country's longest-running cases.

Hindus believe that Lord Ram, a major deity, was born at the site in the northern city of Ayodhya, and that a Muslim conqueror destroyed a temple there in the 1500s and built a mosque in its place.

In 1992 a Hindu mob reduced the mosque to rubble, triggering some of the worst inter-religious violence since independence in 1947 and in which 2,000 people perished.

In 2002 Hindu activists were burned alive in a train returning from Ayodhya, sparking riots that left upwards of 1,000 people dead, most of them Muslims.

Hindu fundamentalists shout and wave banners as they stand on the top of a stone wall and celebrate the destruction of the 16th century Babri Mosque in Ayodhya in 1992
Hindu fundamentalists shout and wave banners as they stand on the top of a stone wall and celebrate the destruction of the 16th century Babri Mosque in Ayodhya in 1992 AFP / DOUGLAS E. CURRAN

The hearings ended in drama on Wednesday, as Rajeev Dhawan, a lawyer for one of the Muslim parties in the case, tore up a map purportedly showing the temple existed in ancient India.

Another lawyer, who is in his 90s, has been representing the infant Lord Ram in the case. Under Indian law, a Hindu deity is considered a "juristic person".

The five judges in the Supreme Court are due to decide how the 2.77-acre (1.1-hectare) site should be divided in a verdict expected by November 17.

The ruling Hindu nationalist party of Prime Minister Narendra Modi, the Bharatiya Janata Party (BJP), has vowed that a temple will be built there.

Security measures have been enhanced in Ayodhya as the case nears its end, with assemblies of more than four people banned.