An unidentified gunman killed six people at a Sikh temple in suburban Milwaukee on Sunday in a rampage that left terrified congregants hiding in closets and others texting friends outside for help. The suspect was killed outside the temple in a shootout with police officers.

Police called the attack an act of domestic terrorism, but did not provide any details about the gunman or suggest a possible motive. Police Chief John Edwards of the suburb of Oak Creek did not say whether the suspect had specifically targeted the Sikh community.

During a chaotic few hours after the first shots were fired, police in tactical gear and carrying assault rifles surrounded the Sikh Temple of Wisconsin with armoured vehicles and ambulances. Witnesses struggled with unrealized fears that several shooters were holding women and children hostage inside.

One of the first officers to respond to frantic 911 calls seeking help was shot several times as he tended to a wounded victim, and was in critical condition along with two other victims Sunday night, authorities said.

"We never thought this could happen to our community," said Devendar Nagra, 48, of Mount Pleasant, Wis., a community 50 kilometres south of Milwaukee. Nagra's sister escaped injury by hiding in the temple's kitchen. "We never did anything wrong to anyone."

FBI leads investigation

Edwards said the FBI will lead the investigation because the shootings are being treated as domestic terrorism, or an attack that originated inside the U.S. He said authorities would not release any more about their investigation until Monday morning, including the names of those killed.

"While the FBI is investigating whether this matter might be an act of domestic terrorism, no motive has been determined at this time," Teresa Carlson, special agent in charge with the agency's Milwaukee division, said in a Sunday night statement.

It appeared the investigation had moved beyond the temple, as police and federal agents swarmed a neighbourhood in nearby Cudahy, evacuating several homes and roping off four blocks around a house where their attention seemed to be focused. Milwaukee County sheriff's spokeswoman Fran McLaughlin said the department's bomb squad was on the scene, though she had no details about why the unit had been called.

People who said family members were in the temple at the time of the shooting gather to wait for more information. (Mike De Sisti/Milwaukee Journal-Sentinel/Associated Press)

Jatinder Mangat, 38, of Racine, Wis., said his uncle Satwant Singh Kaleka, the temple's president, was one of those shot at the temple, but he didn't know the extent of Kaleka's injuries. When he later learned people had died, Mangat said "it was like the heart just sat down."

"This shouldn't happen anywhere," he said.

Edwards said the gunman "ambushed" one of the first officers to arrive at the temple as the officer, a 20-year veteran with tactical experience, tended to a victim outside. A second officer then exchanged gunfire with the suspect, who was fatally shot. Police had earlier said the officer who was shot killed the suspected shooter.

Tactical units went through the temple and found four people dead inside and two outside, in addition to the shooter.

The three wounded were being treated at an area trauma centre. The wounded police officer had surgery and is expected to survive.

Gurpreet Kaur, 24, of Oak Creek, said her mother and a group of about 14 other women were preparing a meal in the temple kitchen when the gunman entered and started firing. Kaur said her mother felt two bullets fly by her as the group fled to the pantry. Her mother suffered what Kaur thought was shrapnel wound in her foot.

Rise in racist attacks reported since 9/11

Many Sikhs in the U.S. worship on Sundays at a temple, or gurdwara, and a typical service consists of meditation and singing in a prayer room where worshippers remove their shoes and sit on the floor. Worshippers gather afterward for a meal that is open to community members, regardless of their religious beliefs.

Sikhism is a monotheistic faith founded more than 500 years ago in South Asia. It has roughly 27 million followers worldwide. Observant Sikhs do not cut their hair; male followers often cover their heads with turbans — which are considered sacred — and refrain from shaving their beards. There are roughly 500,000 Sikhs in the U.S., according to estimates. The majority worldwide live in India.

The New York-based Sikh Coalition has reported more than 700 hate crimes in the U.S. since the Sept. 11 attacks and has fielded complaints in the thousands from Sikhs about workplace discrimination and racial profiling.

With their turbans and long beards, Sikhs are often mistaken for Muslims or Arabs, and have inadvertently become targets of anti-Muslim bias in the United States.