India deployed thousands of troops to prevent an eruption of Hindu-Muslim rioting Wednesday after attackers besieged a major Hindu temple complex in a raid that left 32 people dead, most of them worshippers.

India blamed its bitter rival Pakistan for the attack, which lasted 14 hours until Indian commandos stormed the temple at dawn Wednesday and killed the two gunmen. Pakistan denied the accusation, which hiked up tensions between the nuclear-armed neighbors.

In the western state of Gujarat, where the temple is located, fears were high that the assault would re-spark sectarian bloodshed that tore the state apart earlier this year. At least 1,000 people were killed in Gujarat, most of them Muslims slain by Hindu mobs, in riots after a Muslim attack on Hindu train passengers in February.

The Indian army sent 3,000 soldiers to Gujarat on Wednesday on a request from the state government, which had been criticized for not acting quickly to quell the earlier rioting. Schools, colleges and most businesses were shut in Gandhinagar and the adjoining commercial capital of Ahmadabad amid an opposition strike.

The attack on the Swaminarayan Temple on the outskirts of Gandhinagar, Gujarat's capital, began Tuesday evening, when the gunmen attacked with grenades and assault rifles.

Up to 500 pilgrims, priests, museum guides and souvenir traders were in the complex when the attackers zoomed up in a car, leaped over the fence and began firing. At first the attackers were taken for policemen.

As hundreds of people fled, troops swarmed into the sprawling complex, which centers on a 108-foot-high monument built of pink sandstone. The gunmen eluded government forces for nearly 14 hours, lying quiet for long periods, then returning fire and lobbing grenades, said Brig. Raj Sitapathy, head of the New Delhi-based commando force that led the final assault.

The gunmen were unable to take hostages, because pilgrims either fled or hid themselves in locked rooms. After the siege ended, 65 pilgrims were rescued from one of the rooms, Sitapathy said.

The siege left 27 worshippers or temple workers dead, as well as two police officers, a commando and the two attackers. Seventy-four people were injured, including at least 23 police officers, officials said.

No group claimed responsibility for the attack, and the gunmen were not identified.

But India's deputy prime minister, Lal K. Advani, blamed Pakistan.

Advani referred to a Sept. 12 speech by Pakistan's President Pervez Musharraf to the United Nations, when he condemned the killings of Muslims in Gujarat.

"Our enemy went to the United Nations and spoke about Gujarat," Advani told reporters at the temple site. "From that, it appears they had been planning for some time and this attack has been executed to implement their designs."

In Islamabad, Pakistani Foreign Ministry spokesman Aziz Ahmad Khan dismissed those claims and condemned the temple attack, saying it was intended to heighten tensions.

"These accusations are ridiculous. Such terrorist attacks don't promote any cause," he told The Associated Press.

Sitapathy told The Associated Press that two letters -- written in the Urdu language -- were recovered from the attackers, whose identities have yet to be ascertained. Urdu is spoken in parts of Pakistan and India.

Sitapathy said the letters bore the previously unknown name "Movement for Taking Revenge."

The reference to revenge could indicate a connection to the massacre of Muslims in the earlier Gujarat religious rioting. There was no immediate information about the religion of the men who attacked the temple.

"They were clean-shaven, dressed in civilian clothes and appeared to be in their early 20s," Sitapathy said. They carried dates and candy to give them energy for more than 24 hours, and had grenades, AK-47 assault rifles and loads of ammunition, he said.

In some ways -- their dress, behavior, cache of food, approach to the temple in an Ambassador car used by officials, and quick action -- the gunmen were similar to a group that attacked India's Parliament last Dec. 13. Those men were also young, clean-shaven and dressed in olive-colored civilian clothes.

India claimed those men were Pakistanis and accused Pakistan of plotting the Parliament attack. It led to talk of war and mobilization of 1 million troops, who still remain on the countries' border.

The tension was defused in June, but India has repeatedly said that Islamic militants continue to cross the border to stage attacks, mainly in Jammu-Kashmir, the Himalayan region that India and Pakistan have fought two of their three wars over.

Pakistan says it supports the aim of the militants seeking to separate Muslim majority Jammu-Kashmir from predominantly Hindu India, but denies giving them aid.

Meanwhile, states near Gujarat increased police patrols in areas where Muslims and Hindus live together and posted guards at temples and mosques, fearing a surge in sectarian violence.

"This is adding kerosene to a burning fire. There will be trouble in the riot-prone areas," said Maya Desai, a college student in Ahmadabad, about 15 miles from the attack site.

Gujarat's Chief Minister Narendra Modi -- who is accused by human rights groups, foreign diplomats and Muslims of inciting the anti-Muslim rioting earlier this year -- appealed for calm Wednesday.

In New Delhi, the imam of the country's largest mosque called the attack "anti-Islamic."

The World Hindu Council, an ally of India's ruling Bharatiya Janata Party, called for a nationwide general strike on Thursday to protest what it called "jihadi terrorism."