Police officers carry evidence bags from the family home of Gilroy Garlic Festival gunman Santino William Legan on Monday, July 29, 2019, in Gilroy, California. Picture: AP

Washington - A shooting at a food festival in California could have been far worse if not for the quick response of police officers, the police chief in the town said Monday.

"There absolutely would have been more bloodshed," Scot Smithee, chief of police in Gilroy, told reporters. "It is very, very fortunate that [police officers] were able to engage him as quickly as they did."

Three people were killed and at least 15 were wounded in the shooting at the Gilroy Garlic Festival in the town about 135 kilometres south-east of San Francisco. The dead are a 6-year-old boy, a 13-year-old girl and a man in his 20s. Police still do not know the motive.

The annual three-day festival attracts as many as 100,000 people and was in its last day Sunday when the shooting took place. Several law enforcement officials were working at the festival, aiding in their rapid response, Smithee said.

He also identified the shooter as Santino William Legan, 19, but said he only reluctantly confirmed his name.

"I don't believe someone like this deserves the notoriety," Smithee said.

The gun used was an "AK-47-type assault weapon" that had been purchased legally in the neighbouring state of Nevada on July 9, he added.

Smithee said there had been no confirmation that a second suspect was involved but investigators were still following up leads.

President Donald Trump mentioned the shooting earlier Monday at a White House bill signing event.

"We express our deepest sadness and sorrow for the families who lost a precious loved-one in the horrific shooting," Trump said.