India’s Supreme Court has ordered that the disputed site where a mosque was torn down in 1992 should be handed over to the government for the construction of a Hindu temple.

The judges came to a unanimous verdict, after many decades of dispute and, at times, deadly riots over the Ayodhya site that once housed the Babri Masjid mosque.

Five acres of land in the city must be handed over to the Sunni Waqf Board, representing Muslims in Ayodhya, for the construction of a new mosque, the judges said.

Many Hindus believe that the Ayodhya site is the birthplace of the deity Lord Ram, and say the mosque was built in the 16th century over an ancient temple marking the spot. An archaeological survey of the site found no evidence of this, only that an unspecified structure existed prior to the mosque.

But the issue reached a head in December 1992, when thousands of Hindus descended on the site – tearing down the mosque and triggering deadly communal riots across the country.

There were concerns on Friday that the Supreme Court’s judgement would lead to a new backlash. The government has announced special measures in several places – including parts of Delhi and Mumbai – banning public assembly.

In their judgment, the Supreme Court justices found in favour of Ram Lalla Virajman, the child deity worshipped by Hindus at the site, and ordered the government to – within three months – set up a trust tasked with managing the site on the deity’s behalf.

The judges accepted in practice, which would likely mean the construction of a temple to Lord Ram. Narendra Modi’s Hindu nationalist BJP government has long campaigned for a Ram temple to be built at the site, making it a key pledge ahead of this year’s general election.

Ranjan Gogoi, the Chief Justice of India presiding over the panel of judges, said it was not the court’s job to rule on faith or politics, but that “as a secular institution [it] should uphold all faiths and religions”.

He concluded that Hindus had “always believed birthplace of Lord Ram was in inner courtyard of mosque”, and that the existence of a small shrine to Ram in the outer courtyard meant members of both faiths had used the site continuously.

“There is no evidence to indicate the possession was exclusive by Muslims,” he said, meaning the Sunni Waqf Board had failed to establish “possessory control” of the site.

The judgment nonetheless shot down a 2010 high-court decision that splits up the site, saying that it must be allocated as a whole.

And the judges cited the Archaeological Survey of India’s (ASI) report on Ayodhya, noting that “the Babri Masjid was not constructed on vacant land”. They gave credence to the ASI’s assertion that there may have been a temple at the site, despite the fact that independent archaeological experts have disputed this conclusion.

Vishnu Shankar Jain, a lawyer who represented the Hindu community, called it a “historic moment for Hindus”.

He said the case had been a struggle over many years. “It was a huge legal battle and we are happy that we convinced the Supreme Court,” he said.

Zafaryab Jilani, a lawyer for the Sunni Waqf Board, said the Muslim community was disappointed with the outcome and assessing its options, while respecting the authority of the court.

“We are not satisfied with the verdict and it’s not up to our expectation,” he said. “These 5 acres of land don’t mean anything to us. We are examining the verdict and whatever legal course is open for us.”