Hundreds of thousands of police and paramilitaries have been deployed across India to prevent violence following a long-awaited legal decision on the disputed holy site at Ayodhya, in the north of the country, due today.

The judgment will determine whether Hindus or Muslims have the right to worship on the ruins of a 16th-century mosque in the city. In 1992 the mosque, known as the Babri Masjid, was torn down by Hindu extremists, sparking some of India's worst religious violence since independence. The reaction to today's decision is being seen as a crucial test of India's commitment to secularism and the rule of law.

"The way the country handles this, the aftermath, will have a profound impact on the evolution of our country," Manmohan Singh, the prime minister, said this month.

With only three days before the Commonwealth Games open in Delhi, today's decision poses a new security threat to the athletes and dignitaries already in India. More, including Prince Charles, are due to arrive before the opening ceremony this weekend. About 10,000 tourists are also expected, despite recent bad publicity over hygiene, disease and terrorist threats.

The legal dispute over the site of the Babri Masjid in Ayodha, 350 miles east of the capital, has run for 60 years. Hindu community representatives in India have argued they should be allowed to build a huge temple to the god Ram where the mosque once stood. Local Muslim bodies want permission to rebuild the demolished 16th-century mosque. Repeated attempts at mediation have failed.

Authorities say they are ready to deal with any trouble. Mass text messaging in India has been stopped to prevent organisation of mobs and the circulation of inflammatory rumours. In some states, schools have been shut. Huge numbers of security personnel have been mobilised, co-ordinated by a special cell in the home ministry in Delhi.

In the southern state of Karnataka alone 50,000 police are being deployed. In north-western Rajasthan, more than 20,000 will be assigned to potential troublespots. Others are being kept as an airborne reserve.

Political leaders from all factions have appealed for calm, raising hopes that a repeat of previous violence can be avoided. Sonia Gandhi, president of the centre-left Congress party, which heads the coalition government, yesterday asked Indians to accept the judgment, to be delivered by the Allahabad high court. "I request you keep faith in the Indian judiciary and maintain peace, mutual respect and brotherhood at any cost. Emotional unity is the greatest strength of India," Gandhi said.

Analysts in Indian newspapers have stressed that no political party in India – at either state nor national level – stands to gain from violence.

The original demolition of the mosque and subsequent violence has been blamed on senior politicians from the Hindu nationalist Bharatiya Janata party (BJP). However leaders of the BJP, now in opposition, have recently called for the legal process to be respected.

More hardline elements among the Hindu nationalist movement have also pledged to remain within the law. "All Indians should pray for peace. Peace is very necessary for humans," Swami Chakrapani, president of the All India Hindu Mahasabha organisation, said.

Mohan Bhagwat, leader of the Rashtriya Swayamsewak Sangh, a Hindu paramilitary organisation, said its members would "be striving to see that there will be a grand Ram temple on that site" but their response would "be within the limits of law and constitution".

Key members of India's 150 million Muslim minority also pledged to remain calm. Zafaryab Jilani, of the Sunni Central Waqf Board, said Muslims would react "in a very cool manner". He added: "We will try not to be provoked. There may be some small incidents but we don't expect large scale disturbances."

An appeal to the Indian supreme court after today's decision is almost certain.

Hindus first protested that the Ayodhya mosque, built in 1528 by the Mughal emperor Babur, had been erected at the birthplace of Rama more than 150 years ago. The conflict was aggravated in 1949 when idols of Rama appeared in the mosque. Hindu extremist groups and the BJP then exploited the issue to build mass popular support in the 1980s.

The passions roused by the issue have threatened India's multi-ethnic, secular democracy, many have claimed. Analysts say however that India has now changed enormously since the early 1990s with new economic aspirations stronger than ever before and religious identities weaker. "The whole mood has changed," said Mahesh Rangarajan, a political analyst at Delhi University.

P Chidambaram, the home minister, said India had moved on. "Especially people who were born after 1992.They have a very different world view," he said.