India's top court cleared the way on Saturday for a Hindu temple to be constructed at a hotly disputed holy site, in a huge victory for Hindu nationalists under Prime Minister Narendra Modi.
The Supreme Court ruled that the site in Ayodhya in northern India, where Hindu mobs destroyed a 460-year-old mosque in 1992, must be handed over to a trust to oversee the construction of a Hindu temple, subject to conditions.
A separate piece of land in Ayodhya would be given over to Muslim groups to build a new mosque, the court ruled in a historic judgement aimed at ending a bitter and decades-old legal and sectarian battle.
Ahead of the verdict Indian authorities ramped up security across the country and Modi called for calm as police went on alert.
Thousands of extra personnel deployed and schools closed in and around the northern city of Ayodhya, centre of the bitter dispute, and elsewhere.
Barricades were erected on roads leading to the Supreme Court building in New Delhi with officials and volunteers scouring social media for inflammatory posts in what is Facebook's biggest market.
The verdict, it is hoped, will put an end to an angry and at times arcane legal wrangle that British colonial rulers and even the Dalai Lama tried to mediate.
Hardliners among India's majority Hindus, including supporters of Modi's Hindu nationalist Bharatiya Janata Party (BJP), believe that Lord Ram, the warrior god, was born in Ayodhya.
They say that in the 16th century, Babur, the first emperor of the Mughal Islamic dynasty, built a mosque on top of a temple at the 2.8-acre (1.1-hectare) site.
Victory for Modi
In the 1980s, as Hindu nationalism and the BJP began to strengthen, pressure grew for the mosque to be knocked down and replaced by a glorious Hindu temple.
In 1992, a Hindu mob estimated to number 200,000 did just that, reducing the mosque to rubble.
This unleashed some of the worst religious riots since India's bloody partition at the end of British colonial rule in 1947, leaving around 2,000 people dead, mainly Muslims.
Ten years later in 2002, after 59 Hindu activists died in a blaze on a train from Ayodhya, riots in Gujarat state -- when Modi was its chief minister -- saw upwards of 1,000 people perish, again largely Muslims.
In 2010, a High Court ruled that Muslims and Hindus should split it -- albeit unevenly, with Hindus granted the lion's share.
This left no one happy. Both Hindu and Muslim groups appealed and the Supreme Court in 2011 stayed the lower court's ruling, leaving the issue unresolved.
The case also involves a nonagenarian lawyer representing a Hindu deity and has seen a high drama including a lawyer representing Muslim groups tearing a purported ancient map showing the temple.
The BJP has campaigned for years for a temple to be built at Ayodhya, and the verdict is a major victory for the party, just months into Modi's second term.
But it will also send shudders through many in the 200-million-strong Muslim minority who fear that the BJP is bent on turning India into a purely Hindu nation.
Modi is nevertheless desperate to avoid bloodshed and ahead of the verdict, the BJP and the more hardline RSS organisation have told supporters to avoid any provocative celebrations.
Muslim groups have also appealed for calm.
"Whatever is the verdict by the Supreme Court, it won't be anybody's win or loss," Modi tweeted late Friday.
"My appeal to the people of India is that our priority is to ensure the verdict strengthens the values of peace, equality and goodwill of our country."