A 13-year-old who was shot dead by a gunman at a food festival in California may have inadvertently saved her relative's life.

Keyla Salazar, from San Jose, is one of three people who were killed by the attacker before he was shot dead by police on Sunday.

As the gunshots began to ring out at the Gilroy Garlic Festival and her family began to run to safety, Keyla stayed to walk with a relative who uses a cane.

Image: People run away after shooting at Gilroy Garlic Festival. Pic: @wavyia.

Katiuska Vargas, Keyla's aunt, said her niece was shot with a bullet that otherwise might have hit her relative.

The teenager's stepfather was wounded as he went back for her.


One person remains in a critical condition, with the ages of the 12 people injured ranging from 12 to 69 years old. The youngest to die was six-year-old Stephen Romero.

Santino William Legan, 19, has been identified as the gunman - and police say he cut through a fence before using an assault rifle to shoot people.

Gilroy Police Chief Scot Smithee said it is not yet known if any of the victims were targeted, saying: "The descriptions that have been given to me, it appeared as though it [the shooting] was random. But I think we're too early in the investigation to say that definitively."

Police say the attacker was shot dead by police within minutes, with Mr Smithee commenting: "It could have gone so much worse so fast."

Investigators have searched addresses linked to Legan.

People flee shooting at festival

The semi-automatic rifle used was purchased legally by the attacker in Nevada, where he previously lived.

Guns can be bought in Nevada from the age of 18, but tighter laws in California mean Legan would have been blocked because he is under 21.

President Donald Trump said the gunman was a "wicked murderer" and asked Americans to pray for the victims.

"We grieve for their families, and we ask that God will comfort them with his overflowing mercy and grace," Mr Trump said.

Posts on Legan's social media, on which he says he is of Italian-Iranian descent, included criticism of the festival and lauding a 19th century book associated with white supremacists.

Image: Six-year-old Steven Romero is among those killed in the shooting. Pic: NBC Bay Area

A 20-year-old man was arrested after he claimed online that he was involved in the attack, but was subsequently ruled out after investigators determined he was seeking attention.

One of the largest food festivals in the US, the Gilroy Garlic Festival is an annual three-day event south of San Jose at the outdoor Christmas Hill Park.

The event's website says weapons of any kind are prohibited and it is attended by thousands of people.