A gunman who opened fire at a garlic festival in California, killing at least three people and injuring 15 others, has been shot dead by police with a second suspect still at large.

As videos from the scene showed thousands fleeing and gunshots ringing out, Gilroy’s police chief said the suspect had cut through a fence to access the Gilroy Garlic Festival.

The gunman was confronted and killed by officers less than a minute after he opened fire, Scot Smithee said.

A second suspect was “involved in some way, we just don’t know in what way” and a manhunt is underway to find them, he added.

One witness, Evenny Reyes, said she and others didn’t run at first because the gunshots sounded like fireworks. “It was like the movies – everyone was crying, people were screaming,” she said.

Mass shootings in America Show all 8 1 /8 Mass shootings in America Mass shootings in America Camden shootings – 1949 Howard Unruh killed 13 people, including three children, during a 12-minute walk through his neighborhood on September 6, 1949, in Camden, New Jersey, when he was 28 years old. The incident became known as the "Walk of Death". Unruh was found to be criminally insane and died in 2009 after a lengthy illness at the age of 88, following 60 years of confinement. Alamy Mass shootings in America University of Texas tower shooting – 1966 Charles Whitman killed 17 people and injured 31 others in Austin, Texas. After stabbing his mother and wife the night before, he headed to the University of Texas, where he opened fire on people in the campus and streets from the observation desk. He was shot dead after a policeman and civilian reached the scene. Austin History Center, Austin Public Library Mass shootings in America Easter Sunday Massacre – 1975 James Ruppert killd 11 family members in his mother's house, which included his mother, brother and his wife, as well as their eight children. He used a magnum, two handguns and a rifle. Mass shootings in America Wilkes-Barre shootings – 1982 Former prison guard, George Banks, shot dead 13 people in Pennsylvania, including five of his own children. AP Photo/Times Leader Mass shootings in America Wah Mee massacre – 1983 Three men, Kwan Fai Mak, Wai-Chiu Ng, and Benjamin Ng, killed 13 people who were in Seattle's Wah Mee gambling club. YouTube/KIRO 7 News Mass shootings in America San Ysidro McDonald's massacre – 1984 James Huberty killed 21 people and injured 19 others after he walked in a McDonald's in San Diego. He was shot dead by a sniper after 78 minutes of him entering the restaurant. Alamy Mass shootings in America Palm Sunday massacre – 1984 Ten people were shot dead from handguns at close range in a New York home. A baby girl was the only survivor after convicted dealer, Christopher Thomas, shot three women, one teenage girl and six children in their Brooklyn home. Thomas was convicted of manslaughter and cleared of murder. He was released from prison after 32 years. Mass shootings in America Edmond post office shooting – 1986 Patrick Sherrill, a postal worker at the Edmond post office in Oklahoma, killed 14 co-workers and injured 6 others, before he shot himself. Oklahoma Highway Patrol Collection

The festival is a nationally famous three-day event that attracts upwards of 100,000 garlic enthusiasts from across the country. Sunday was the last day of festivities.

Todd Jones, a sound engineer, told the Mercury News that he was at the front of the festival’s Vineyard stage when he heard what sounded like a firework.

“But then it started to increase, more rapidly, which sounded more like gunfire, and at that point people realised what was happening,” Jones said.

Singer Jack van Breen said his band Tin Man was just starting an encore when the first shots rang out.

Police chief says some witnesses have reported a possible second suspect in the Gilroy Garlic Festival shooting

He said he saw a man wearing a green shirt and greyish handkerchief around his neck fire into the food area with what looked like an assault rifle.

Van Breen and other members of the band dove under the stage, he told the Associated Press. He said he heard someone shout: “Why are you doing this? “and the reply: “because I’m really angry.”

Agents from federal agencies including the Bureau of Alcohol, Tobacco, Firearms and Explosives were at the scene and responding to the shooting.

The Gilroy Police Department issued a statement on Twitter urging people who had become separated from loved ones in the chaos to meet at a nearby college car park.

“The hearts of Gilroy PD and entire community go out to the victims of today’s shooting at the Garlic Festival,” the statement read.

Videos from the scene showed many families with young children among those trying to flee. Ms Reyes, 13, said she had been attending the festival with friends and family.

“We were just leaving and we saw a guy with a bandana wrapped around his leg because he got shot,” she told Mercury News.

“And there were people on the ground, crying. There was a little kid hurt on the ground. People were throwing tables and cutting fences to get out.”

Donald Trump tweeted about the shooting on Sunday night. He wrote: “Law Enforcement is at the scene of shootings in Gilroy, California. Reports are that shooter has not yet been apprehended. Be careful and safe!”