Social media video grab of people running away as an active shooter was reported at the Gilroy Garlic Festival on Sunday. Reuters
Among the victims was a six-year-old boy, his grandmother told US media, while at least 15 others were injured.
Officers confronted and shot dead the suspect "in less than a minute," said Scot Smithee, police chief of the city of Gilroy, 48 kilometres southeast of San Jose.
Police officers escort people from Christmas Hill Park following a deadly shooting during the Gilroy Garlic Festival. AP
A search for a possible second suspect was ongoing, Smithee said, adding that the site of the three-day Gilroy Garlic Festival was "still an active crime scene."
"We believe based on witness statements that there was a second individual involved in some way, we just don't know in what way," he told journalists.
The grandmother of six-year-old Stephen Romero said he was shot while attending the event with his mother and other grandmother.
Describing her grandson as "always kind, happy and... playful," Maribel Romero told ABC7 News Stephen had died by the time she arrived at hospital.
Footage showed people fleeing in terror as shots rang out at one of the largest food festivals in the country.
A witness named Julissa Contreras told NBC a white man in his 30s armed with a rifle opened fire indiscriminately.
"I could see him shooting in just every direction. He wasn't aiming at anyone specifically. It was just left to right, right to left," Contreras said, according to NBC.
People wait for relatives at a reunification center at Gavilan College following a shooting at the Gilroy Garlic Festival. AP
"He definitely was prepared for what he was doing," she said.
Smithee said the suspect appeared to have entered the 50-acre festival site via a creek, using cutting equipment to breach the event's perimeter.
Metal detectors and bag searches were in place as part of "very tight security" at the festival, he said.
No motive was known but the suspect's shooting appeared "somewhat random," Smithee added. The suspect used "some sort of a rifle," he said.
US President Donald Trump earlier tweeted that law enforcement officers were at "the scene of shootings" in Gilroy, urging members of the public to "Be careful and safe!"
Festival director Brian Bowe told reporters it was "horribly upsetting" that the attack happened on the third and final day of this year's event in Gilroy, which he described as an "amazing... a tightly-knit community."
"Our 4,000-plus local volunteers work so hard every year and to see this event end this way is just one of the most tragic and sad things that I've ever had to see," Bowe said.
"We feel so upset for those that are impacted — friends, families, neighbors. It's just a horrible thing to experience."
California governor Gavin Newsom said the incident was "nothing short of horrific."
"Tonight, (California) stands with the Gilroy community. My office is monitoring the situation closely," he tweeted.
"Grateful for the law enforcement's efforts and their continued work as this situation develops."
This screen grab taken from a handout video footage shows people running away from gunshots. AFP
The Mercury News reported that the shooting took place as the festival was winding down.
Stagehand Shawn Viaggi hit the ground after hearing "loud pops," it said.
"I called out, 'It's a real gun, let's get out of here,' and we hid under the stage," Viaggi said, according to the newspaper.
The Gilroy Garlic Festival features live entertainment including bands and cooking competitions as well as food and drink, and draws nearly 100,000 people over three days each year, according to organisers.
The family event is a major focal point for the small city of around 50,000.
Thirteen-year-old Evenny Reyes told the Mercury News that "we were just leaving and we saw a guy with a bandana wrapped around his leg because he got shot. And there were people on the ground, crying."
"There was a little kid hurt on the ground. People were throwing tables and cutting fences to get out," said Reyes.
"Grateful to first responders who are on the scene in Gilroy and keeping those injured by such senseless violence in my thoughts," Senator Kamala Harris, who is running for the 2020 Democratic presidential nomination, wrote on Twitter.
shootings are a frequent occurrence in the United States, but despite the scale of the gun violence problem in the country, efforts to address it legislatively have long been largely deadlocked at the federal level.
Primarily aimed at protecting the rights of black Americans who favor the distinctive cuts, The law is was passed unanimously by both state chambers.
The shooting in the town of Poway, north of San Diego, came exactly six months after a white supremacist killed 11 people at Pittsburgh's Tree of Life synagogue — the deadliest attack on the Jewish community in US history.
The shooter was also killed after an extended gun battle with responding officers, in a scene that "best could be described as a war zone," Virginia Beach police chief James Cervera told a news conference.
A total of 129 members of Trump's Republican Party joined Democrats as the House denounced the withdrawal of US troops from northern Syria in a 354-60 vote.
The spokesman added that the passengers include Asian and Arabic nationalities, and that the accident happened after a bus crashed.
Prime Minister Boris Johnson said on Thursday that Britain and the European Union had agreed a "great" new Brexit deal and urged lawmakers to approve it at the weekend.