A teen who opened fire at his California high school, killing two students, used a "ghost gun" built from firearm parts, the Los Angeles County sheriff said.

The weapon was a "kit gun" with no serial numbers, and another kit gun was found at the family's home, Sheriff Alex Villanueva told television station KABC.

It was unclear who assembled the gun. Weapons assembled at home, allowing owners to avoid registering them, are commonly called ghost guns.

Villanueva said the suspect’s father, who died in 2017, at one point had six firearms registered to him, but those guns had been lawfully removed from the home and were legally destroyed. He was then considered a "prohibited possessor" who could not legally own a gun, but Villanueva did not say why.

The 16-year-old shot five students in the quad area of Saugus High School in Santa Clarita, a city north of Los Angeles, on Nov. 14 before turning the weapon on himself, authorities said. He died the next day.

A motive in the shooting has not been determined, Villanueva told the station. Authorities have been unable to unlock his cell phone and were working with federal agencies to access to it, he said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings.

"The why is still a mystery to this date," Villanueva said.

Villanueva has called the shooting a "planned attack." The student, Nathaniel Tennosuke Berhow, was dropped off at school by his mother that day and pulled the handgun from a backpack before opening fire, officials have said.

Gracie Muehlberger, 16, and Dominic Blackwell, 14, were killed.

NBC News had reported that officials were looking at whether the handgun used was a “ghost gun.”

That the weapon used was manufactured from parts was also confirmed by the special agent in charge of the federal Bureau of Alcohol, Tobacco, Firearms and Explosives Los Angeles field office, Carlos A. Canino.

Villanueva told KABC that gun kits, which involve a weapon 80 percent already completed, with the remaining 20 percent to be assembled at home, are legal to buy, but they can allow people to escape registering them. "That is very dangerous," the sheriff said.

California has some of the strictest gun laws in the nation. In 2016, then-California Gov. Jerry Brown signed a bill into law that required the owners of ghost guns to apply for serial numbers in the state.

Gov. Gavin Newsom in October signed a bill into law that would require firearm precursor parts used to assemble ghost guns to be sold by licensed dealers and requiring a background check. The law does not take effect until 2024.

In Southern California, federal authorities say one-third of all the firearms seized are ghost guns, The Associated Press reported.

Self-assembled firearms have been used in other shootings in California, including a 2017 mass shooting in Rancho Tehama Reserve in Northern California that killed four people and injured 10 others.

In August, a semi-automatic assault-style rifle used by a gunman to shoot three California Highway Patrol officers in the Los Angeles area was a homemade ghost gun, law enforcement officials said.

The shooter opened fire after being stopped in Riverside and after an officer was preparing to have his vehicle impounded. CHP Officer Andre Moye Jr. was killed, and the gunman was shot dead by law enforcement officers.

Andrew Blankstein is an investigative reporter for NBC News. He covers the Western United States, specializing in crime, courts and homeland security. 

Phil Helsel

Phil Helsel is a reporter for NBC News.