The Gilroy Garlic Festival was about to finish for the weekend on Sunday evening, when shots were fired at the site.
There was "a white man in his early to mid-30s firing a rifle," eyewitness Julissa Contreras told NBC.
Video posted on social media showed people running away from the festival site amid general confusion.
The Santa Clara County Medical Center has so far admitted two victims, CBS reports.
"It was just rapid firing," Ms Contreras told NBC Bay Area. "I could see him shooting in just every direction. He wasn't aiming at anyone specifically.