Authorities said a tall, bald, white man in his 40s opened fire just before services had begun, entering the kitchen at the Sikh Temple of Wisconsin in suburban Milwaukee at about 10:30 a.m. CDT (1530 GMT) as women prepared a Sunday meal, sending worshippers fleeing to escape the barrage.
Some witnesses said he had a 9/11 tattoo, marking the September 11, 2001 attacks by Islamic militants.
"He had tattoos, I don't know what the exact markings were, or if they represented any of his beliefs or what they stood for," said Thomas Ahern, a spokesman for the U.S. Bureau of Alcohol, Tobacco, Firearms and Explosives.
Four people were shot dead inside the sprawling temple. Three more, including the gunman, were killed outside.
The gunman ambushed and shot a police officer who was responding to a 911 call and helping a shooting victim, Oak Creek Police Chief John Edwards said. A second officer shot and killed the gunman.
The wounded officer, a 20-year veteran, was taken to a hospital and is expected to survive. Hospital officials said two other victims, also in critical condition, were being treated.
Authorities did not release the name of the suspect. They said the shooter had used a 9mm semi-automatic pistol, which was recovered at the scene. Officials were tracing origin of the weapon, Ahern said.
Police surrounded and searched a gray, two-storey house in the Cudahy neighborhood, presumed to be the residence of the gunman on Sunday evening. Generators and floodlights were set up along the middle-class block.
A police source confirmed that a search warrant had been issued for the house, and a bomb squad was on the scene.
Temple member and U.S. Army Reserve combat medic Jagpal Singh, 29, said people who were at the service when the shooting broke out described to him a scene of chaos and confusion.
Worshippers scrambled to escape the gunfire, but some tragically ran in the wrong direction. Others survived the rampage by locking themselves in bathrooms, he said.
Family and friends of the victims gathered in the basement of a nearby bowling alley as they waited for their loved ones to be identified. While the names of the victims had not been released by late Sunday, several members said the congregation president and a priest were among them.
Turban-wearing Sikhs are often mistaken for Muslims, and the Federal Bureau of Investigation is overseeing the probe into shootings, Edwards said.
"We're treating this as a domestic terrorist incident," he told reporters. Officials had no details about a possible motive.
Milwaukee's Froedtert Hospital said three male victims included one who had been shot in the abdomen, one in the extremities and face, and a third who was hit in the neck.
The Oak Creek shooting was the latest in a series of suburban U.S. gun rampages. Organizations fighting gun violence rate Wisconsin's gun safety laws as weak. There are no limits on the number of firearms that can be purchased at one time, nor on the possession or transfer of assault weapons, according to the Law Center to Prevent Gun Violence.
Wisconsin Republican Governor Scott Walker signed a law in July 2011 allowing citizens to carry concealed weapon, making the state the 49th to allow the practice. Only neighboring Illinois does not.
Sunday's attack came just over two weeks after a gunman opened fire at a theater in Aurora, Colorado, killing 12 people and wounding 58. In January 2011, then-congresswomen Gabrielle Giffords was the target of an assassination attempt in which six people were killed and 13 were wounded in Tucson, Arizona.
"The gunman is worse than the one at the theater a couple of weeks ago because he targeted an entire community," said Jagatjit Sidhu, who was among dozens of temple members and onlookers gathered near the sealed off temple.
President Barack Obama and presumed Republican presidential nominee Mitt Romney both said they were saddened by the attack.
South Carolina Governor Nikki Haley, who grew up as a Sikh, also joined in the condolences.
Sikhs in US
The Indian embassy in Washington said it was in touch with the National Security Council about the shooting and an Indian diplomat had been sent to the Sikh temple in Wisconsin.
The Sikh faith is the fifth-largest in the world, with more than 30 million followers. It includes belief in one God and that the goal of life is to lead an exemplary existence.
The temple in Oak Creek, south of Milwaukee, was founded in October 1997 and has a congregation of 350 to 400 people. There are an estimated 500,000 or more Sikhs in the United States.
Since the attacks of Sept. 11, 2001 by Islamist militants, Sikhs have sometimes been confused publicly with Muslims because of their turban headdress and beards.
Members of the Milwaukee Sikh community complained to police and a state representative last year about an upturn in robberies and vandalism at Sikh-owned gas stations and stores.
The Sikh Coalition, the nation's largest Sikh advocacy group, said it had received thousands of requests for assistance from members of the community related to employment discrimination, hate crimes and school bullying since the September 11, 2001 attacks.
"For God's sake leave us alone," said Jagjit Singh Kaleka, the brother of one of the Wisconsin victims.