Footage on social media showed festival attendees scattering in fear and confusion.

Police were searching on Monday for a suspected accomplice of the gunman who killed three people, including a 6-year-old boy, in a mass shooting at a food festival in California.

The gunman was shot dead by police officers within minutes of opening fire early on Sunday evening at the three-day Gilroy Garlic Festival, about 30 miles (48 km) southeast of the city of San Jose.

Among those killed was a 6-year-old boy, according to news reports. Fifteen people were injured, but it was unclear how many were shot or otherwise hurt in the crush of bystanders trying to flee, according to police. One person was in critical condition, a hospital spokeswoman said.

A second suspect "was involved in some way, we just don't know in what way," Gilroy Police Chief Scot Smithee said late on Sunday, without giving further details.

"We have no idea of a motive," he said.

Police recovered a rifle at the scene, Smithee said.

The gunman, who has not been publicly identified, cut through a fence to evade metal detectors and other security at the festival's entrance, police said.

Footage uploaded to social media showed festival attendees scattering in fear and confusion as loud popping sounds could be heard in the background.

"What's going on?" a woman can be heard asking on one video. "Who'd shoot up a garlic festival?"

'THROWING TABLES' TO GET OUT

One of the victims was identified by his grandmother as Stephen Romero in an interview with ABC7 News. Maribel Romero described her 6-year-old grandson as "a really loving boy."

Her daughter-in-law and the boy's other grandmother were also being treated in hospital for gunshot wounds, she said. "I want justice for my grandson," she said.

Evenny Reyes, 13, told the San Jose Mercury News that at first she thought the gunfire was fireworks but then saw someone with a wounded leg.

"We were just leaving and we saw a guy with a bandana wrapped around his leg because he got shot," Reyes told the newspaper. "There was a little kid hurt on the ground. People were throwing tables and cutting fences to get out."

Maximo Rocha, a volunteer with the Gilroy Browns youth football team, said he saw many people on the ground, but could not be sure how many were shot.

He told NBC Bay Area that "quite a few" were injured, "because I helped a few."

One video posted on Twitter showed a blood-spattered woman sitting in the back of a semi-trailer and telling a man she had been shot in the hand.

Founded in 1979, the Gilroy Garlic Festival is an annual event run by volunteers and held outdoors at Christmas Hill Park.

Weapons of any kind are prohibited, according to the event's website, which also said anyone wearing clothing or paraphernalia indicating membership in a gang, including a motorcycle club, would be refused entry.

"I want to express my extreme shock and sadness about what's happened today," said Gilroy Mayor Roland Velasco at a late night press conference. "I would ask for the thoughts and prayers of the community as our Gilroy police officers continue to investigate this tragic and senseless crime."