Gilroy, California (CNN) An AK-47 style rifle legally purchased in Nevada and used to attack people at the Gilroy Garlic Festival in northern California couldn't have been purchased legally in California, state Attorney General Xavier Becerra said Monday.

Becerra said it's also illegal to transport the assault-style weapon into the state.

"That weapon could not be sold in California. That weapon cannot be imported into the state of California," Becerra said in response to a question about the assault-style rifle used in the shooting.

Becerra added: "There is a very strong likelihood as we develop the evidence that the perpetrator in this particular case violated California law on top of the crimes of homicide and so forth, the crimes that we have that are meant to prevent individuals from carrying out this type of activity."

Santino William Legan, 19, killed three people and injured at least 12 others at the festival on Sunday with the rifle he bought July 9 in neighboring Nevada, Gilroy Police Chief Scot Smithee told reporters Monday. Three officers who responded within a minute of the gunfire fatally shot Legan, he said.

in Gilroy, a city about 30 miles south of San Jose. Legan apparently entered the annual festival, which attracts about 100,000 people every year, by using a tool to cut through a back fence and then began shooting at random, the chief said. Smithee credited a heavy police presence for saving lives as chaos descended on the festivalin Gilroy, a city about 30 miles south of San Jose.

Photos: In photos: Shooting at California garlic festival Kirstin Bright, left, leans on Jessica Bright during a vigil at the Gilroy Police Department in California on Monday, July 29. Kirstin was at the Gilroy Garlic Festival during the deadly shooting on Sunday. Hide Caption 1 of 14 Photos: In photos: Shooting at California garlic festival Police vehicles arrive on the scene following a deadly shooting at the Gilroy Garlic Festival on Sunday. Hide Caption 2 of 14 Photos: In photos: Shooting at California garlic festival Police officers escort people from Christmas Hill Park following the shooting. Hide Caption 3 of 14 Photos: In photos: Shooting at California garlic festival A woman reacts as she and others are escorted from the park. Hide Caption 4 of 14 Photos: In photos: Shooting at California garlic festival Police hold a position at the scene. Hide Caption 5 of 14 Photos: In photos: Shooting at California garlic festival Jane and Edward Jacobucci wait on a chartered bus after leaving the festival area. Hide Caption 6 of 14 Photos: In photos: Shooting at California garlic festival Gilroy Police Chief Scot Smithee talks to the media at a reunification center at Gavilan College. Hide Caption 7 of 14 Photos: In photos: Shooting at California garlic festival Festival attendees are transported to a reunification center at Gavilan College. Hide Caption 8 of 14 Photos: In photos: Shooting at California garlic festival A police officer stands guard at Gilroy High School after the shooting. Hide Caption 9 of 14 Photos: In photos: Shooting at California garlic festival People leave the festival grounds. Hide Caption 10 of 14 Photos: In photos: Shooting at California garlic festival Bystanders look on following the shooting. Hide Caption 11 of 14 Photos: In photos: Shooting at California garlic festival In this image, taken from a video posted on social media, people are seen running as an active shooter is reported at the festival. Hide Caption 12 of 14 Photos: In photos: Shooting at California garlic festival Emergency vehicles rush toward the festival location. Hide Caption 13 of 14 Photos: In photos: Shooting at California garlic festival In this image, taken from a video posted on social media, people scramble amid reports of the shooting. Hide Caption 14 of 14

Authorities have obtained a warrant to search the vehicle the shooter drove to the festival and a Gilroy residence associated with him, according to Smithee. The FBI also searched a Walker Lake, Nevada, residence believed to have been used by the gunman prior to the shooting, Mineral County District Attorney Sean Rowe said.

Police recovered a firearm and rifle ammunition from the shooting scene, a law enforcement source told CNN.

Authorities earlier said they were searching for a second person who witnesses said may have been involved in the shooting. But on Monday, Smithee said multiple people had given differing versions of this person, "so we really don't know at this point."

Shooter should 'rot in hell,' gun shop owner says

The shooter purchased the rifle off the internet page of Big Mike's Guns and Ammo in Fallon, Nevada, the business said in a Facebook post

"I did not know this individual. He ordered the rifle off my internet page. When I did see him, he was acting happy and showed no reasons for concern. I would never ever sell any firearm to anyone who acted wrong or looks associated with any bad group like white power," the post said.

CNN has reached out to law enforcement to confirm the gun shop's statements. The store couldn't be reached.

In a separate post the gun shop said: "The shooter in CA, I hope you rot in hell. We pray for the victims. My heart hurts for all of them."

Instagram posts before shooting

An Instagram account bearing the shooter's name , created four days ago, posted two messages shortly before the attacks, including a reference to a white supremacist text.

One post was a photo of people walking around the Garlic Festival with the words "Ayyy garlic festival time Come get wasted on overpriced sh**." The other post, made about an hour later, showed a sign of Smokey Bear saying "Fire Danger High Today."

"Read Might is Right by Ragnar Redbeard," the caption said. "Why overcrowd towns and pave more open space to make room for hordes of mestizos and Silicon Valley white tw**s?"

A "mestizo" is a person of mixed descent, usually white and Hispanic, or white and American Indian. "Might is Right" is a book published in the late 1800s which has been described as a white supremacist text that promotes anarchy, vilifies Christianity and calls Jesus the "true Prince of Evil." The natural order, according to the book, is a world at war in which the strong must vanquish the weak, and white men must rule over those of color.

Smithee said police took into custody a 20-year-old man who falsely claimed to be involved in the shooting.

"We've determined that he was not involved in the shooting, that just thought it would be a fun way to get some attention," he said.

They thought the pops were fireworks

," and musicians, including Colbie Caillat and her band, Gone West, performed. Over the course of the three-day festival, families sampled garlicky foods like pasta con pesto and garlic-laced calamari and scampi, kids posed with festival mascot " Herbie and musicians, including Colbie Caillat and her band, Gone West, performed.

The pop-pop-pop of gunfire began just after 5:40 p.m. as the rock band TinMan played its last song.

"We ran off the stage (and) we crawled underneath it," TinMan singer Christian Swain said. "We could smell the gunpowder."

Videos of the aftermath show people screaming and fleeing to safety. Lex De La Herran was walking away as the music on stage was winding down, he said.

"I turned around for a quick moment and I hear the gunshot sounds," he said. "At first I thought it was fireworks but a man behind me screamed that 'those are real, those are real.'"

"I just froze like a deer in the headlights," he said.

De La Herran said a piece of shrapnel hit him in the head. Then, he started running among the crowds.

"I saw people jumping over the fence, people trampling over each other, it was just widespread chaos," he said.

Another screengrab taken from video and uploaded to Twitter appears to show people scrambling at the Gilroy Garlic Festival.

The victims

Stephen Romero, 6, was killed during the shooting, Gilroy City Council member Fred M. Tovar told CNN.

Tovar said he was "deeply saddened by the news."

Stephen Romero, 6, was killed during the shooting at the Garlic Festival in Gilroy, California.

"I pray that God will grant his family strength," he said in a statement. "I will keep your family close in my thoughts and prayers in the coming weeks as you are going through the process of grieving," he said in a statement.

Stephen's grandmother spoke to CNN affiliate KRON about the boy's death.

"This is really hard, there's no words to describe (it)," Romero's grandmother told the affiliate. "He was such a happy kid, I don't think that this is fair."

The teenage victim is 13-year-old Keyla Salazar of San Jose, according to the Santa Clara County Office of the Medical Examiner-Coroner.

Keuka College in upstate New York identified the third victim as Trevor Irby, 2017 graduate.

Irby was a biology major, school president Amy Storey said in a statement.

"We are shocked that this latest episode of senseless gun violence resulted in the loss of one of our recent graduates—graduates in whom we place so much hope because of their potential to create a brighter tomorrow," Storey said.

Festival celebrates community

Police stay focused on a target after a deadly shooting at the Gilroy Garlic Festival in Northern California.

the self-proclaimed garlic capital of the world, according to attendance records. There's food, live music, cooking competitions and thousands of community volunteers who bring it all together. The multi-day festival attracts about 100,000 people annually to Gilroy,the self-proclaimed garlic capital of the world, according to attendance records. There's food, live music, cooking competitions and thousands of community volunteers who bring it all together.

Vendors sell locally-grown garlic at the Gilroy Garlic Festival in Gilroy, Calif., on July 24, 2004.

"To have seen this event end this way this day is just one of the most tragic and sad things that I've ever had to see," Gilroy Garlic Festival Executive Director Brian Bowe said.

Gilroy, a city of about 59,000 people , is a "tightly-knit," family-like community, Bowe said.

"And for over four decades," Bowe said," that festival has been our annual family reunion."