Officials report the shooting, which also left more than a dozen hurt, was reported around 5:40 p.m.
Law enforcement sources tell ABC7 News a 6-year-old boy was among the victims killed in the shooting.
RELATED: Grandmother says she wants justice for 6-year-old shot, killed at garlic festival
The conditions of the hospitalized victims injured at the annual event range from fair to critical, a hospital spokeswoman said.
Police Chief Scot Smithee says the shooting took place on north side of the festival. Officers were in the area and engaged with the suspect who had a rifle. The suspect was shot and killed.
RELATED: 'I feel like he made eye contact with me': Witness describes Gilroy shooting
According to the chief, the suspect got inside the event through the creek and used an unknown tool to cut into the fence.
Smithee says they're looking for a possible second suspect, who may have accompanied the gunman. He says a search is underway to find that person.
A motive for the shooting is not known.
RELATED: Band describes gunshots that rang out while they were on stage at Gilroy Garlic Festival
Gilroy police are asking any witnesses who have not contacted them yet to call 408-846-0583. They advise anyone looking to reunite with a loved one to call 408-846-0584.
The ATF reported in a tweet that the agency's San Francisco Field Division is responding to the shooting.
Gov. Gavin Newsom sent a statement on Twitter, saying the shooting was "nothing short of horrific."
This is nothing short of horrific. Tonight, CA stands with the Gilroy community. My office is monitoring the situation closely. Grateful for the law enforcement’s efforts and their continued work as this situation develops. https://t.co/GrtHjtCEz7— Gavin Newsom (@GavinNewsom) July 29, 2019
President Trump tweeted about the shooting, telling his followers to "be careful and safe!"
Law Enforcement is at the scene of shootings in Gilroy, California. Reports are that shooter has not yet been apprehended. Be careful and safe!— Donald J. Trump (@realDonaldTrump) July 29, 2019
Senator Kamala Harris says her office is monitoring the situation, "Grateful to first responders who are on the scene in Gilroy and keeping those injured by such senseless violence in my thoughts. My office is closely monitoring the situation."
Video on social media sites showed people running for safety at the festival.
The shooting occurred during the annual three-day celebration featuring food, cooking competitions and music that attracts more than 100,000 people.
Get the latest on the deadly Gilroy Garlic Festival shooting here.