The 19-year-old man who killed three people and wounded a dozen more at a Northen California food festival on Sunday bought his rifle legally in Nevada but brought it into California illegally under the state's ban on so-called assault-style weapons, officials said.

Craig Fair, the FBI's deputy special agent in charge of the San Francisco Division, said investigators were still trying to learn more about Santino William Legan and what prompted him to fire the AK-47 style rifle at the Gilroy Garlic Festival.

Law enforcement officials described Legan as "kind of a loner." Fair said people acting alone were "exceptionally dangerous" because they often didn't communicate their plans to anyone in advance.

CALIFORNIA POLICE CARRY OUT SEARCH WARRANTS AT GILROY GARLIC FESTIVAL SHOOTER’S HOME

Gilroy Police Chief Scot Smithee said at a news conference Tuesday that Legan -- whom police killed soon after he opened fire, killing two children and a man -- appeared to have acted alone during his shooting spree. A search of his car yielded a shotgun and a bag of ammunition in a creek near the festival, Smithee said.

In Legan's Nevada apartment, police found a bulletproof vest, empty shotgun and rifle boxes, a gas mask, empty ammunition boxes, hard drives and other electronic devices.

WITNESSES RECALL CHAOTIC SCENE AS SHOTS RANG OUT

Smithee initially described the weapon as an "SKS," but officials later clarified the weapon was a semi-automatic variant of an AK-47.

"That weapon could not be sold in California. That weapon cannot be imported into the state of California," state Attorney General Xavier Becerra said. "The reach of the California law ends at our borders, and so we cannot control what other states do, and that's what makes it so tough."

2020 DEMOCRAT PRESIDENTIAL CANDIDATES RESPOND TO SHOOTING

A law enforcement official told The Associated Press that investigators believed the gunman used a WASR-10, which is a Romanian variant of the AK-47, and sold for about $700 at Big Mike's Guns and Ammo in Fallon, Nevada, where he picked up the weapon.

The shooting killed 6-year-old Stephen Romero, 13-year-old Keyla Salazar and Trevor Irby, a 25-year-old college graduate from upstate New York. Eight people remained hospitalized, KTVU in San Francisco reported Tuesday.

The gun shop wrote on its Facebook page that it hoped Legan rots "in hell."

"The shooter in CA, I hope you rot in hell,” the post states. “We pray for the victims. My heart hurts for all of them."

CLICK HERE TO GET THE FOX NEWS APP

Investigators said Tuesday that Legan had recently lived in Gilroy, California, and Walker Lake, Nevada, a few miles north of Hawthorne. The FBI was asking fairgoers to submit photos and videos taken during the event to its website to help paint a "bigger picture" of what happened.

California Gov. Gavin Newsom visited some of the victims and their families. He cursed as he condemned what he said was a refusal by federal lawmakers to control high-powered, high-capacity guns that have been more tightly restricted in his state.

The Associated Press contributed to this report.