Three people were killed, including a 6-year-old boy and a 13-year-old girl, and 12 others were wounded Sunday after a gunman cut through a fence to avoid security and opened fire at the Gilroy Garlic Festival in Gilroy, California.

The gunman, who was shot and killed by police, has been identified as Santino William Legan, a federal law enforcement official confirmed to NBC News. Police in a news conference Monday said the gunman used an AK-47 type assault rifle purchased legally in Nevada on July 9.

"This is a tragic incident for our community," Gilroy Mayor Roland Velasco said. "On behalf of the city and the Gilroy City Council our thoughts and prayers go out the victims and families."

There were reports that a second suspect may have been involved in the shooting. Police are still trying to determine if that is the case.

"We don't have any confirmation that any second suspect did any shooting, but we certainly are investigating all leads to try to determine who that potential second suspect is and what exactly that person's role was," Gilroy Police Chief Scot Smithee said Monday.

A motive behind the shooting remains unknown, Smithee said.

Patrice Waugh describes the scene following a shooting at the Gilroy Garlic Festival.

The 6-year-old boy who died was identified as Stephen Romero by members of his family.

"My son had his whole life to live and he was only 6," his father Alberto Romero told NBC Bay Area. "That's all I can say."

The other male victim who died was identified as 25-year-old Trevor Irby, a 2017 graduate of Keuka College in New York, according to the school. Keyla Salazar, a 13-year-old girl from San Jose, was identified as the third person who was killed, according to the Santa Clara County Office of the Medical Examiner-Coroner.

Police and emergency personnel responded to reports of an active shooter incident at Gilroy's Christmas Hill Park at around 5:40 p.m. PT, Smithee said. Officers engaged the suspect and killed him within a minute.

Witnesses reported seeing a potential second suspect, and as of early Monday morning the scene was still active, with multiple agencies searching for the possible outstanding suspect, according to Gilroy police.

[NATL] Gilroy Garlic Festival Turns Deadly After Gunman Opens Fire

Late Sunday, officials said 15 people were injured in the shooting. They later clarified to say 12 people were hurt.

Officials with Santa Clara Valley Medical Center said they received five victims from the shooting, including two major trauma victims from St. Louise Hospital in Gilroy.

St. Louise initially received six gunshot wound victims, and of the four that remained there, one died, a hospital spokesperson said.

An official with Regional Medical Center in San Jose said the hospital received four victims, one of whom was in critical condition.

One witness told NBC Bay Area he was on his way out of the festival when he felt a bullet pass by his head, and when he turned around, he saw everyone running.

Another witness said some people were stranded at nearby Las Animas Elementary School.

San Jose police and fire units responded to the scene to assist, according to a tweet from Mayor Sam Liccardo. Santa Clara County Sheriff's deputies also were on scene, along with California Highway Patrol units.

For those searching for loved ones, a reunification center was set up at nearby Gavilan College in parking lot B, according to Gilroy police.

Gilroy Police Chief Scot Smithee provides updates on the deadly mass shooting at the city’s annual garlic festival.

President Donald Trump, Gov. Gavin Newsom and other political leaders reacted to the shooting on social media late Sunday.

Attorney General William Barr was also briefed on the shooting, and the Justice Department is providing resources and monitoring the situation, a department spokesperson said early Monday.

The festival, now in its 41st year, is a local tradition that attracts thousands annually. It was wrapping up its third and final day when reports of the shooting came in.

NBC Bay Area's Laura Garcia, Marianne Favro, Robert Handa and Janelle Wang contributed to this report.