Six people plus gunman die in Wisconsin temple shooting ITN / Reuters

A gunman shot dead six worshippers at a Sikh temple before opening fire on officers in what police described as an act of US "domestic terrorism".

The attack began shortly before 10.30am local time on Sunday as dozens of people were gathering at a place of worship in Oak Creek, Wisconsin.

After killing a number of people inside the temple, the gunman then fired on a police officer who was helping a wounded victim outside the building. A second officer fired on the suspect, who died at the scene. The wounded officer – who was shot multiple times – was taken to hospital for surgery. He is expected to survive.

At a press conference held outside the temple on Sunday, Oak Creek police chief John Edwards said the "heroic actions" of the two officers "stopped this from being worse than it could have been", noting that many people had gathered for worship at the time of the attack.

Edwards said that authorities were treating the killing as a "domestic terrorism incident", but added that it was too early to suggest a motive. Some Sikh members of the community told the media they feared that it was a hate crime. "We are at the beginning stages of this investigation," Edwards said. The FBI has taken over the criminal inquiry.

Police officers ride on an armored vehicle near the scene of the shooting in Oak Creek, Wisconsin. Photograph: Tannen Maury/EPA

It is thought that around 50 people were in the temple as the shootings took place. Prominent members of the local Sikh community were among those thought to have been injured or killed by the gunman.

Jatin Der Mangat, 38, of Racine, said his uncle, the temple's president Satwant Singh Kaleka, was one of those wounded, but he didn't know how serious his injuries were. "It was like the heart just sat down," he said. "This shouldn't happen anywhere."

Sukhwindar Nagr, also of Racine, said he called his brother-in-law's phone – a senior religous figure at the temple answered and told him that his brother-in-law had been shot, along with three other people. Children hid in closets in the temple amid fears that the suspect was still on the loose, Nagr was told.

CNN reported that two handguns were recovered by forensic experts at the scene. But initial fears that the gunman may have had an accomplice appear to be unfounded. There are often reports of multiple gunmen at incidents of mass shootings, because of the confusion, large number of witnesses and different perspectives. Police said sweeps of the temple and the surrounding area suggested that the shooting was the act of a lone killer.

Alongside the six people the suspect shot, three people were injured and taken to a nearby hospital. They were all in critical condition. The officer who was shot by the gunman is among those being treated. "We expect him to recover", Edwards said.

Police said the unnamed officer was "ambushed" by the gunman as he and a colleague responded to a 911 call alerting authorities to the scene of the shootings. Emergency teams later found the bodies of four victims inside the temple. Three more corpses lay outside the building, including that of the suspect.

For hours after the initial incident, a cordon was placed around the temple amid fears that a second armed man remained at large. Ambulances and police marksman surrounded the temple. The cordon was raised when police were sure that no other peope were involved.

Bradley Wentlandt, police chief of the nearby town of Greenfield, confirmed later that there was only one suspect. "There is no evidence of additional shooters at the temple," he said.

Despite fears that the attack may have had a racist motive, some in the Sikh community cautioned against jumping to conclusions. Sapreet Kaur, executive director of the Sikh Coalition, the largest Sikh American civil rights organisation in the US, said: "There have been multiple hate crime shootings within the Sikh community in recent years and the natural impulse of our community is to unfortunately assume the same in this case.

"Let's let law enforcement investigate the case and as new facts emerge the dialogue can change," he urged.

Kaur added: "Americans died today in a senseless act of violence and Americans of all faiths should stand in unified support with their Sikh brothers and sisters."

The incident in Wisconsin comes just 16 days after 12 people were killed and nearly 60 injured in a mass shooting at a movie theatre in Aurora, Colorado, during a midnight screening of The Dark Knight Rises.

President Barack Obama was informed of the latest atrocity shortly before 1pm ET by homeland security adviser John Brennan. In a statement, the president said he was "deeply saddened". He added: "At this difficult time, the people of Oak Creek must know that the American people have them in our thoughts and prayers, and our hearts go out to the families and friends of those who were killed and wounded."

Obama's Republican challenger for the White House, Mitt Romney, expressed his condolences to those caught up in America's latest mass shooting.

• This article was amended on 6 August 2012 to remove a reference to 'priests' in relation to the temple.