For 150 years, Hindus and Muslims both claimed a site that is sacred to their religions, which triggered some of the worst rioting in India's history. On Thursday, a court came up with a compromise: Split it.
Both sides said they would appeal, and the muted reaction to the potentially explosive verdict generated hopes that the increasingly confident country, with its growing regional clout and skyrocketing economy, has moved beyond its divisive history.
"(This) shows that we have become a mature nation," said Kamal Farooqui, a member of the Muslim Personal Law Board.
In advance of the ruling, the government sent hundreds of thousands of police into the streets, arrested more than 10,000 people to keep them from inciting violence, and pushed another 100,000 to sign affidavits saying they would not cause trouble.
The dispute over the religious site in the city of Ayodhya, 350 miles (550 kilometers) east of New Delhi, has been one of the country's most contentious issues.
Hindus argued that the Babri Mosque erected there by Muslims in 1528 stood on the site of the birthplace of the Hindu god Rama, and they filed suit in 1950.
In 1992, while the legal case lingered, tens of thousands of Hindu extremists ripped apart the mosque with spades, crowbars and their bare hands as security forces watched. A small tented shrine to Rama now stands on the site.
The demolition sparked nationwide riots that killed 2,000 people and shook the foundations of India's claim to be a multiethnic, secular democracy.
The High Court in the state of Uttar Pradesh ruled that the 64-acre (25-hectare) site should be split, one-third to the Muslim community and the rest to two Hindu groups.
The Hindus will keep the area where the mosque once stood because the court determined it was the birthplace of Rama and archaeological evidence showed a temple had predated the mosque, according to the judgment.
Hindus want to build an enormous temple to Rama on the site, while Muslims want to rebuild the mosque. The ruling will likely force both groups to scale down those plans.
The court said the status quo should be maintained at the site for three months.
"It's not a victory or defeat for any party. It's a step forward. We hope this matter will be resolved," said Zaffaryab Jilani, a lawyer for the Muslim community, who said he would appeal the verdict to the Supreme Court.
H.S. Jain, one of the Hindu plaintiffs, also said he would appeal because "100 percent of the land belongs to Hindus. Why split it?"
Public reaction to the verdict was restrained.
In Ayodhya, Hindus rushed to nearby temples to give thanks, but the atmosphere throughout town was peaceful. In Lucknow, where the decision was issued, shops were closed, streets were deserted and police were on patrol in the hours after the verdict.
Hindu and Muslim groups in Mumbai, a flash point for previous Hindu-Muslim violence over the temple dispute, appealed for peace.
"We hope all problems regarding matters with Hindus and Muslims can be settled in this amicable way," said Haji Arfat, a leader of the Maharashtra Navnirman Sena, an offshoot of the Shiv Sena, a Hindu fundamentalist group.
More than 40,000 police and paramilitary forces had fanned out across the city, liquor stores and many schools were closed and many business shut down early in anticipation of the ruling. But there were no signs of violence in India's financial capital.
Many in India say the country has moved on, with Hindu nationalist groups on the wane and the younger generation more interested in their education and cell phones than communal divisions.
Even hard-liners called for healing.
Mohan Bhagwat, the chief of the Hindu nationalist Rashtriya Swayamsevak Sangh, which was implicated in the destruction of the mosque, said the ruling should clear the way for construction of the Rama temple.
"I will appeal to Muslims to forget the past. We have got an opportunity to act together," he said.
Narendra Modi, the chief minister of Gujarat state that saw some of India's worst religious rioting, said the judgment would "strengthen the country's unity."
Many of those accused of inciting violence two decades ago also appealed for peace.
Lal Krishna Advani, a prominent leader of the Hindu nationalist Bharatiya Janata Party, has been charged over his alleged connection to the demolition, although his trial has been mired for years.
On Thursday, he praised the country for receiving the verdict with maturity, and said it "opens a new chapter for national integration."
Nessman reported from New Delhi. Associated Press writers Erika Kinetz in Mumbai and Nirmala George and Ashok Sharma in New Delhi contributed to this report.