At least three people were killed, including two children, and 12 others wounded in a shooting at the Gilroy Garlic Festival in Northern California after a suspect wearing tactical gear and armed with an military-style rifle opened fire, authorities and witnesses said Sunday night.

"It's sort of a nightmare you hope you never have to live in reality," Gilroy police Chief Scot Smithee said at a news conference.

The suspect, identified Monday as Santino William Legan, was shot and killed by the police. "I say that name with some hesitation," Smithee said. "I don’t believe that someone like this deserves the notoriety or the recognition."

Smithee said the suspect appeared to be firing "somewhat randomly," and that investigators had no information on a possible motive.

He said that police believed a second person may have been involved, but that they didn't know in what way.

"We are no closer to determining whether there was or was not a second suspect and if there was what role they made have had," he told reporters at a Monday afternoon news conference.

Smithee said authorities briefly detained a person who claimed on social media to have "shot up" the garlic festival. Investigators quickly determined that the person, who identified himself as "Chase M. Killings," wasn't involved, Smithee said.

"He just thought it would be a fun way to get some attention, apparently," Smithee said.

One of those killed was 6-year-old Stephen Romero. Stephen was at the festival with his mother and grandmother, who were also injured in the shooting. A 13-year-old girl, Keyla Salazar, and a man in his 20s, Trevor Irby, were also killed.

Those with gunshot wounds were taken to two hospitals after the shooting at one of the largest food festivals in the United States, Joy Alexiou, a spokeswoman for the Santa Clara County Public Health System, said.

Five people remained hospitalized on Monday. Three were in serious or fair condition, Alexiou said. Two did not want their information released.

Gilroy, a city of 60,000 about 30 miles south of San Jose, has held its popular food festival that celebrates the local garlic industry since 1979.

Smithee said police were on-site during the entire duration of the three-day festival, and officers engaged with the suspect in less than a minute. Despite being "outgunned" with handguns against the shooter's assault-type weapon, they fatally wounded him quickly, Smithee said.

"I can’t tell you how proud I am of the officers for being able to engage this guy as quickly as they did. It could have gone so much worse so fast," Smithee said, adding that the festival packs tens of thousands of people into a very small area.

The SKS rifle, which is an AK-47-type assault-style weapon, was purchased legally in Nevada on July 9, Smithee said.

Gilroy Mayor Roland Velasco declared a proclamation of a local emergency early Monday morning as the investigation into the shooting continues.

"I would ask for the thoughts and prayers of the community as our officers continue to investigate this tragic and senseless crime," Velasco said.

Police officers escort people from Christmas Hill Park following the shootings at the festival. Noah Berger / AP

The San Francisco Division of the Bureau of Alcohol, Tobacco, Firearms and Explosives said it was responding to the scene in Gilroy. The FBI is also assisting with the investigation.

The festival was near the end of its third and final day when the gunshots were reported at about 5:41 p.m., Smithee said, adding that the gunman appeared to have cut through a fence to get into the event.

Julissa Contreras, a witness who said she was a former police cadet, said in an interview Sunday night that she saw "your average white guy" firing what appeared to be a semi-automatic rifle, "kind of just going left to right and shooting whoever he could, honestly."

Contreras said the man, who she said didn't say anything, paused and appeared to reload.

"He definitely shot off more than 30 rounds," she said. "It was just like nonstop — just like two, three, four shots a second."

Contreras described the man as in his 30s, wearing a cap, sports sunglasses and what appeared to be military-style clothing.

"He looked like, oh, he could work private security," she said. "But he had, like, straps and clips, and he was completely prepared for what he was doing. Absolutely."

Maximo Rocha, a volunteer with the Gilroy Browns, a Pop Warner youth football team, said he saw many people on the ground, although he couldn't be sure how many may have been shot and how many may have been trying to protect themselves.

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

But he told NBC Bay Area that "quite a few" of them were injured in some fashion, "because I helped a few."

Gloria Parker, another witness, told the station that she and other people began running when they heard 10 to 15 bangs that they initially thought were firecrackers.

"There was tons of cops there," she said.

Another eyewitness, Ryan Wallace, who was working at the event as a vendor, told NBC Bay Area that the shooter was dressed in police-style uniform and was "spraying out rounds all around" while "walking like a police, like he wanted to get stuff done."

Cheryl Low and Candice Marquez, who were also working at the festival when the shooting occurred, told "Today" on Monday morning they were only about 10 to 15 feet away from the shooter when they noticed him.

Low's boss and her boss's husband were both shot and taken to the hospital, the latter hit three times and now in critical condition. Low’s granddaughter, in a nearby tent, helped shield the three-year old son of her grandma's boss during the shooting.

“She was a hero,” Marquez said. “She grabbed him and saved his life.”

Addressing suggestions that security at the event could have been tighter, Contreras said: "Honestly, security was great. They weren't extremely invasive, but they checked my fanny pack and my backpack, and I felt they were thorough.

"You know, metal detectors are not going to really deter or do anything to someone who's carrying a semi-automatic rifle that's very visible," she said.

Contreras said she wasn't particularly shocked by the shooting.

"It's a shame that it's happening, but I think this is just a reflection of the current political climate, wherein people are feeling more comfortable being violent," she said.

"This is the America we live in now, which I'm kind of ashamed to say as a U.S. citizen."

The garlic festival draws celebrity chefs from around the country and live performances by musicians. On Saturday, “Top Chef” host Tom Colicchio attended, tweeting on Sunday after the shooting “prayers go out to all.”

The event was held in Gilroy’s Christmas Hill Park, which according to the event’s website has an explicit policy banning all weapons.

CORRECTION (July 29, 2019, 1:52 p.m. ET): An earlier version of this article misspelled the first name of the 6-year-old victim. He was Stephen Romero, not Steven.