The 16-year-old accused of shooting multiple classmates, two fatally, has died from a self-inflicted gunshot wound, authorities confirmed on Friday.
He was identified by authorities as Nathaniel Tennosuke Berhow.
The three teenagers who survived being shot at their Santa Clarita, California, high school Thursday are all on the road to recovery, officials said.
Two of the five victims, 15-year-old Gracie Anne Muehlberger and a 14-year-old boy, died in the hospital after the attack at Saugus High School. The boy has been identified as Dominic Blackwell.
The three other students shot -- a 15-year-old girl, a 14-year-old girl and a 14-year-old boy -- are all expected to survive.
A male student, on his 16th birthday, was in the quad around 7:30 a.m. local time when he took a pistol from his backpack and unloaded the entire magazine, firing six rounds apparently at random, shooting five classmates and himself, Los Angeles County Sheriff Alex Villanueva said.
Villanueva described it as a planned, deliberate attack, but the motive is unclear.
The gunman was counting his bullets, the sheriff said, and was skilled in using guns. When the weapon jammed, he quickly managed to clear it and keep firing, authorities said, citing surveillance video.
"From the time that he withdrew the handgun from his backpack to the time that he was on the ground with a gunshot wound to his head was about 16 seconds," Capt. Kent Wegener of the Los Angeles County Sheriff's Department told reporters late Thursday.
The injured 15-year-old girl was shot below the bellybutton and has a bullet lodged in her hip, while the 14-year-old girl was shot in the shoulder and abdomen, hospital officials said Friday.
Both girls, who know each other, were rushed to the same hospital where they are recovering. Both should be discharged in the next few days, officials said.
The girls "held their composure despite being shot," said Dr. Boris Borazjani, a trauma surgeon at Providence Holy Cross Hospital. "I'm very proud."
The teens were "stoic" and "composed, talking to us and I think they were handling it exceptionally well," doctors said Friday.
The injured 14-year-old boy has already been released from the hospital.
The shooting "shook every one of us to our core," said Deputy Superintendent Mike Kuhlman.
Choir teacher Kaitlin Holt said one girl, shot in the hip and shoulder, was rushed into her classroom by other students. She gave the wounded student first aid and called 911.
"I should have never had to treat a gunshot wound as a choir teacher," Holt told ABC News. "And there's something really wrong and something has to change, 'cause I held a bleeding child today in a room with 40 sobbing children."
Now, as the community wades through the chaos and grief, authorities are desperate for answers.
It "still remains a mystery why," Villanueva said Friday.
"We have not yet established a motive or a nexus between the subject and his victims other than to say that they were all students at the high school together," Wegener said.
There's no evidence so far to suggest the suspect acted on behalf of a group or with any co-conspirators, authorities added.
The suspect was dropped off at school on Thursday by his mom, the sheriff added.
A .45 caliber semiautomatic pistol was recovered from the crime scene. Several guns registered to the suspect's father were recovered at the teen's home, Villanueva said. Other guns found at the suspect's home were not registered to anyone, he noted.
The suspect's mother and girlfriend have met with detectives, according to authorities.
The William S. Hart Union High School District, which includes Saugus High School, canceled Friday classes at all of its schools in the wake of the attack.
The school district holds shooting trainings, though "we prayed that we would never need it," Kuhlman, the deputy superintendent, said in a letter to the community on Thursday.
"Yet today, our brilliant staff bravely and vigilantly went into action," Kuhlman said. "Placing a priority on their students’ safety, our wonderful Saugus High School team were quick to order students to shelter in place, and your students responded."
Kuhlman wrote to the parents: "Hold your children tight. Love them. Praise them for being responsible in the face of fear."