The disputed holy site of Ayodhya in northern India should be given to Hindus who want a temple built there, the country’s Supreme Court has ruled.
The case, contested for decades by Hindus and Muslims, centres on the ownership of the land in Uttar Pradesh state.
Muslims would get another plot of land to construct a mosque, the court said.
Many Hindus believe the site is the birthplace of one of their most revered deities, Lord Ram.
Muslims say they have worshipped there for generations.
At the centre of the row is the 16th Century Babri mosque that was demolished by Hindu mobs in 1992, sparking riots that killed nearly 2,000 people.
Hundreds of people were detained in Ayodhya on Friday ahead of the verdict, amid fears of violence.
Thousands of police personnel have also been deployed in the city, and shops and colleges have been shut until Monday.
Social media platforms are being monitored for inflammatory content, with police even replying to tweets and asking users to delete them.
Prime Minister Narendra Modi and other political leaders have appealed for calm.