Gunman shot dead by police as authorities look for a second suspect following shooting in annual California food event.

A gunman has opened fire at a food festival in the US state of California, killing at least three people and wounding 15 others before being shot dead by police.

Local police chief Scot Smithee said authorities were still looking for a second suspect following Sunday’s attack at Gilroy Garlic Festival, in northern California.

“This is incredibly hard and disheartening,” Smithee said in a press conference early on Monday morning.

Witnesses reported confusion and panic as shots rang out at the festival in Gilroy, a city of 50,000 people located about 176km southeast of San Francisco.

Smithee said investigators believe the gunman, who was engaged by police within a minute of opening fire at around 5:40pm (00:40 GMT on Monday), used “some sort of tool” to cut through a fence and gain access to the venue.

He added that attendees had to go through security checkpoints with metal detectors.

The annual festival is a three-day celebration featuring food, cooking competitions and music that attracts more than 100,000 people. Sunday was the final day of this year’s event.

Gilroy Mayor Roland Velasco said an “active investigation” was under way.

“I want to express my extreme shock and sadness for what happened today,” he said. “This is a tragic and senseless crime.”

Authorities said police are still looking for a second suspect of the attack [Josie Lepe/AP]

Earlier, a spokeswoman for Stanford Medical Center said two people wounded in the shooting were being treated there. Julie Greicius said she had no details on their injuries or conditions.

Santa Clara Valley Medical Center received five victims, according to spokeswoman Joy Alexiou, who also did not have any information on their conditions.

Meanwhile, President Donald Trump wrote on Twitter: “Law Enforcement is at the scene of shootings in Gilroy, California. Reports are that shooter has not yet been apprehended. Be careful and safe!”

NBC Bay Area reported that ambulance crews were told that several people “were down” after shots rang out at the location of the Gilroy Garlic Festival.

#BREAKING UPDATE: Ambulance crews were told 11 people down in a reported shooting at the Gilroy Garlic Festival. https://t.co/ufzR4VllUL pic.twitter.com/giApm5t2bX — Stephen Ellison (@sj_ellison) July 29, 2019

Evenny Reyes, 13, told a local newspaper that she spent the day at the festival with her friends and relatives.

“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,” Reyes said. “There was a little kid hurt on the ground. People were throwing tables and cutting fences to get out.”

Reyes said that she did not run at first because the gunshots sounded like fireworks.

“It started going for five minutes, maybe three. It was like the movies – everyone was crying, people were screaming.”

Videos posted on social media appeared to show festival attendees scattering in confusion as at least one loud popping sound 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?”