New Delhi, India (CNN) -- A disputed holy site in India will be divided in an attempt to satisfy competing religious claims to the site, the Allahabad High Court ruled Thursday.
Muslims, Hindus and a local sect all will get part of the land at Ayodhya, the court said.
Muslims have already said they will appeal to the Supreme Court.
Thousands of people have died in sectarian violence in India since Hindu extremists razed a Muslim mosque on the site in 1992. Many Hindus believe the site is the birthplace of one of their most revered deities.
They will be allowed to keep an idol in a makeshift temple under the central dome at the site, Judge S. U. Khan announced in his ruling. Khan is one of three judges on the high court.
"All three sets of parties, i.e., Muslims, Hindus and Nirmohi Akhara are declared joint title holders of the property," Khan wrote.
He gave them three months to come up with proposals for which sections of the property they want, while awarding some specific areas to Nirmohi Akhara, a local Hindu sect.
India beefed up security across the country as it braced for the verdict, deploying hundreds of thousands of troops in anticipation of possible violence.
The destruction of Ayodhya's Babri mosque in 1992 sparked religious riots across India, in which more than 2,000 people died. It was some of the worst violence the country has seen since independence in 1947.
But India appeared to remain calm on Thursday. Prime Minister Manmohan Singh urged citizens not to let extremists stir up violence.
"Often it is only a few mischief makers who create divisions in our society. I would appeal to my countrymen to be vigilant and not let such people succeed in disrupting peace and harmony," he said in a statement after the ruling was announced.
"It is my hope that the response of the people of India to the judgement will be respectful, dignified and do our country proud," he said, adding that it was "correct" to maintain the status quo until the Supreme Court hears the case.
The Allahabad court was asked to rule on a number of issues in addition to the dispute over the ownership of the land, which has been going on for decades.
But it is not clear from their rulings if the judges were able to agree on points including whether the Hindu deity Lord Rama was actually born there and when the Babri Mosque was built.
Like India itself, they appear to have split on religious lines.
India is a majority Hindu country, but has more than 160 million Muslims. In fact, only two other countries, Indonesia and Pakistan, have more Muslims than India, although India is only about 13 percent Muslim, according to the Pew Forum on Religion and Public Life.
India's government was determined to prevent sectarian violence over the Ayodhya ruling.
Paramilitary forces were deployed in the state of Uttar Pradesh, Home Ministry spokesman Onkar Kedia said Thursday. In the rest of the country, paramilitary forces and air force aircraft are being kept on reserve.
About 190,000 forces are in place in Uttar Pradesh, Kedia said, without disclosing the total number of troops that have been deployed across India as a "precautionary measure."
India's Home Ministry also has temporarily banned bulk text messages and has urged the media to exercise restraint and to not sensationalize any possible violence.
The town of Ayodhya has been a religious flashpoint for more than 400 years. Hindus believe that Lord Rama, one of the religion's most revered deities, was born there.
The Babri Mosque was built on the site after the region became part of the Mughal Empire in the 1500s.
Two years after independence, in 1949, the gates to the site were locked after Muslims claimed Hindus had placed deities of Rama in their area.
Hindu groups have pushed to build a temple in Ayodhya, to replace the mosque torn down by Hindu extremists.
This month, Hindus and Muslims were urged to pray for peace after a judgment date was announced, and some Ayodhya residents fled to avoid potential violence.
CNN's Sumnima Udas and Sara Sidner contributed to this report.