SANTA CLARITA, Calif. – As gunshots at Saugus High School sent frightened students fleeing the building, a detective and two off-duty officers who were dropping off their own kids ran toward the sound of gunfire, providing life-saving first aid to the victims, Los Angeles County Sheriff Alex Villanueva said.

In only 16 seconds, two teenagers — a 16-year-old girl and a 14-year-old boy — were killed and three were wounded Thursday at the suburban Los Angeles high school in Santa Clarita.

The attacker, a fellow student who turned 16 on Thursday, was hospitalized in grave condition after shooting himself in the head, according to surveillance video, authorities said. The teenager later died at about 3:30 p.m. Friday at a hospital with his mother nearby, the Los Angeles County Sheriff’s Department announced.

Authorities are still searching for a motive, Villanueva said at a press conference Friday afternoon.

Villanueva said the shooter appeared to act deliberately, as he knew exactly how many rounds were in the firearm. “In 16 seconds he cleared a malfunction and was able to shoot five people and himself, so he seemed very familiar with the weapon,” Villanueva said. “It wasn’t a spur of the moment act.”

Doctors at Providence Holy Cross Medical Center said Friday that two of the injured victims, a 15-year-old girl and a 14-year-old girl, would be discharged soon.

“These are historic young adults,” said Dr. Boris Borazjani. “They held their composure despite being shot, and being shot in the torso is a big deal.”

What we know: The latest on the Saugus High School suspected gunman, victims

Doctors said that the victims were also working through the “profound psychological effect” of the incident and would receive support and counseling from professionals at the hospital.

The two victims who died were identified Friday as Gracie Anne Muehlberger, 15, and Dominic Blackwell, 14.

Story continues

Borazjani noted that the medical center has been organizing training sessions with community groups to teach them how to stop hemorrhaging and were holding a "stop the bleed" course at a local high school Thursday when the attack occurred at Saugus.

In the attack, officials said the teenager, armed with a .45-caliber semiautomatic weapon, apparently acted alone. There was no indication that he was affiliated with a group or ideology, said Paul Delacourt, the agent in charge of the FBI’s Los Angeles field office.

Villanueva told reporters that lives were saved by the quick action of off-duty officers who rushed into the school to try to confront the attacker and tend to the victims.

"Off-duty first responders were there and did not hesitate, turned around and went right into the source of the gunfire to attempt to neutralize it, and they rendered first aid immediately," he said.

They realized immediately that the shooter was down and quickly grabbed the school's trauma kits to begin treating the victims.

"Their actions definitely saved lives, and my hat’s off to them," the sheriff said.

'He doesn't seem like the kind of kid to do this: Classmates, neighbors surprised by suspected Santa Clarita shooter's identity

Detective Daniel Finn, of the Los Angeles county station in Santa Clarita, was the first one in. He had just dropped off a family member when the shooting began, the sheriff said.

He "was exiting, driving away from the school along the perimeter, when he saw all of the children running away from the sound of the gunfire," Villanueva said. "He turned around and became the very first person on scene."

He was joined by Officer Sean Yanez from the Inglewood Police Department and Officer Gus Ramirez from Los Angeles Police Department.

"So the three of them were the very first on scene and they entered the school literally within seconds of the shooting," he said.

Other uniformed deputies from the local sheriff's station also arrived within a minute, including Deputy James Callahan, who works as a school resource officer at the high school.

"As soon as they saw the six victims, they saw the handgun was there, they realized there was not a pending threat immediately and they tended to the care of all of the victims and got the first aid rolling," the sheriff said.

Shauna Orandi, 16, was in her Spanish class when she heard four gunshots and a student burst in to say he had seen the shooter.

“My worst nightmare actually came true,” she said. “This is it. I’m gonna die.”

At a vigil Thursday evening, Lea Reas said her nephew, a 14-year-old freshman, ran after watching his friend shot to death. A teacher pulled him to safety into a room.

“At first he thought it was a graze” but later was told his friend had died, she said. “He lost it.”

Classmates have identified the boy to USA TODAY, although law enforcement has yet to name him publicly because he is a minor.

Sheriff's Capt. Kent Wegener said at a news conference that video of the incident shows that the attack took place quickly and in one location in the school quad.

Wegener said that an Instagram account which posted a threat against the school Wednesday was not linked to the subject but originated out of the country. Facebook deactivated the account. Authorities are still working to identify any accounts belonging to the shooter.

“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,” Wegener said.

Authorities have not identified a motive or rationale and have uncovered no manifesto, diary, suicide note or writings, Wegener said.

Authorities are still analyzing the weapon and its origin. The crime scene has been processed and a 3D scan was performed, Wegener said.

“This morning as we all woke up, we all felt that it is a reality,” said Marsha McLean, mayor of Santa Clarita.

McLean said the town would be holding a vigil Sunday, where community members would hold lights in silver and blue to “commemorate and celebrate” Saugus High School.

She also said the city is launching a website Friday at saugustrong.org to provide resources to the community.

Brooke Risley, 16, described the shooter as a nice, normal student who was on the cross-country team and was a member of the Boy Scouts.

“He doesn’t seem like the kind of kid to do this,” she said.

Though he was the quiet sort, Risley said he had tight friends and was deeply hurt by the death of his father when he was in ninth grade.

“He was open to his close friends. When his dad passed, that was really hard for him,” said Risley, a junior who said she worked on an engineering class project with the suspect last year.

Josie Romero, whose son is a sophomore at Saugus High School, said she didn’t sleep the night of the attack.

“I’m up and down. I’m traumatized,” she said. “I feel like we’ve all lost that innocence.”

Romero said her son Jackson Dobin, 15, prefers to arrive at school early to hang out with friends on the quad, where the shooting occurred. But they arrived late on Thursday morning because she had lost her AirPods and had stopped to search for them.

Just as they were pulling up to the school, they saw groups of kids running diagonal across the street. “One minute sooner, Jackson could have been dead,” Romero said.

Some students hopped in random cars to take shelter. One left a single sneaker lying the middle of the street.

Jackson began crying “quiet tears” in the passenger seat as he looked down at his phone, Romero said.

Contributing: The Associated Press

Santa Clarita shooting: Students made an active shooter video. Two months later, they took shelter in fear

This article originally appeared on USA TODAY: Santa Clarita shooting: Off-duty cops rushed to California school