A six-year-old boy and 13-year-old girl were among those killed by a gunman who opened fire at a popular food festival in California on Sunday.

Santino William Legan, 19, appeared to target people randomly as he began shooting at the Gilroy Garlic Festival after cutting through a fence to gain entry, according to the police.

He killed three people and injured another 12 with an assault-style rifle before being fatally shot by police officers who responded to the incident in less than a minute.

Six-year-old Stephen Romero, the 13-year-old girl and a man in his 20s were killed, officials and authorities said. The motive for the attack is unclear.

Alberto Romero, Stephen's father, told the San Francisco Bay Area news station KNTV: "My son had his whole life to live and he was only 6. That's all I can say."

The attack came at the end of the three-day festival in Gilroy, a city in north California known as the "Garlic Capital of the World”. The event is attended by more than 100,000 people.

Festival attendees have to pass through metal detectors and have their bags searched, but the shooter is believed to have gained access through a fence near a car park. Details of the attack are still emerging.