Hours after the attack, the gunmen remained in control of part of the Swaminarayan temple complex - and some worshippers were still inside, officials said. Bloody bodies were carried away on stretchers and many wounded limped out, their clothes stained with blood. About 45 people were wounded.
Hundreds of commandos swarmed into the sprawling temple complex after the attackers stormed in, setting up positions around the main temple, said R.B. Brahmabhatt, the city's acting police chief. A senior police official inside the complex, speaking on his mobile phone, said between 40 and 50 people had been taken hostage.
There were two attackers inside, and security forces were "waiting until they exhaust their ammunition,'' to launch their offensive, said G.M. Singhal, another official involved in the operation.
Deputy Prime Minister Lal K. Advani, speaking to reporters in New Delhi, described the shooting as a suicide attack. He said the attackers, armed with hand grenades and AK-47 rifles, had taken up positions on the roof of a building inside the complex.
Hospital officials said 30 people were dead, including at least six women and four children. The wounded included five police officers who were hit by bullets. "The terrorists are still inside,'' Advani said. He said 500 people had been evacuated from the complex.
Advani said the attack appeared tied to state elections being held Tuesday in northern Jammu-Kashmir state, the only majority Muslim state in largely Hindu India. "The enemies of the nation feel that the developments in Jammu and Kashmir are strengthening India's viewpoint, and that a big attack could divert attention from there. I see in this a very deliberate design,'' he said. He did not elaborate. India alleges that its neighbor, Pakistan, sponsors Muslim terrorists in Indian territory. Islamabad denies it.
While no group immediately claimed responsibility for the attack, and government officials were careful not to make accusations, fears spread across western Gujarat state that Islamic rebels would be blamed - which could set off anti-Muslim mob violence and spiral into widespread sectarian unrest. "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. "Shops are closing. Everyone is telling each other 'Come on, go home.' Anything can happen now.'' But there were no reports of rioting by midnight.
Security was tightened in Gujarat and several other states with large populations of both Hindus and Muslims, and state and national officials repeatedly called for calm. Gujarat witnessed vicious religious rioting in late February, when a Muslim mob set fire to a train carrying Hindu activists. That attack set off a wave of reprisal killings and rioting in which Muslims were the main victims. In total, about 1,000 people were killed, according to government estimates. "I hope people will understand that communal conflict would serve the interest of those who do this,'' Advani said, appealing for peace.
In New Delhi, the imam of the country's largest mosque called the attack "anti-Islamic.'' "Islam does not permit the killing of innocent civilians. I appeal to Muslims and our Hindu brethren to join hands to wipe out terrorism,'' Syed Ahmed Bukhari was quoted as saying by the Press Trust of India news agency.
But 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.'' India's opposition Congress party planned a Gujarat state strike for Wednesday.
Witnesses said the attack began at 4:40 p.m., when the gunmen leaped out of a car and jumped a fence to enter the 23-acre complex. Jitu Shah, a 26-year-old tour guide, had just seen some customers to the gate when he was stunned by an explosion and the sudden vision of a man with a submachine gun. "He was in his early 20s, was wearing a pair of black trousers and an olive green shirt,'' Shah told the Associated Press. "He suddenly started firing.''
One bullet hit Shah in his left leg. As he fell to the ground, writhing in pain, and crawled to a nearby bush, he said he asked himself: "Why is this policeman shooting at me?''
There were a number of reports that the gunmen were dressed as police officers - a ploy commonly used by Muslim militants - though officials said they could not confirm that. Shah was rescued by security forces almost three hours later. Balwant Shukwant Patel, 25, was relaxing with his girlfriend when the shooting started. "I saw five gunmen inside,'' said Patel. "We were sitting under a tree when they started firing indiscriminately. We thought someone was setting off firecrackers. People started running here and there.''
Shooting continued from inside the temple hours after nightfall, and soldiers set up powerful spotlights around the scene. "Our first priority is to see that the people who were worshipping inside are brought out safely,'' junior Interior Minister I.D. Swamy told Zee News television. "We cannot fire indiscriminately like the terrorists. No one should be hurt in the cross fire.''
The temple, an ornate sandstone complex, is enormously popular among Hindus, with thousands of worshippers arriving every day.