UPDATE: The student who opened fire at his Southern California high school on his 16th birthday, killing two students and injuring three others before shooting himself in the head, died Friday, Los Angeles County Sheriff's officials said.

He "was being treated for a self-inflicted gunshot wound to the head, when he succumbed to his injuries," officials said in a statement. "His mother was present at the time of his passing."

Earlier Friday, Los Angeles County Sheriff Alex Villanueva said the Thursday morning attack appeared to have been planned, but, "it still remains a mystery why."

"We know it was a planned attack," he said. "It was deliberate."

The suspected gunman, identified by multiple law enforcement officers as Nathaniel Tennosuke Berhow, pulled a .45 caliber semi-automatic pistol from his backpack in the quad area of Saugus High School and opened fire, according to officials.

The first reports of the shooting were logged at 7:38 a.m. Thursday, they said.

The suspect had been dropped off at school by his mother, the sheriff said. He was standing by himself, walked to the quad area, dropped his backpack and started firing, striking random targets, Villanueva said.

He cleared a malfunction with the weapon and was able to squeeze off several shots, all within 16 seconds, the sheriff said. He "seemed very familiar with firing the weapon," he said.

Villanueva said students recently underwent active shooter training and when violence erupted Thursday, "did exactly as they were trained" by running and hiding.

School resource Deputy James Callahan told reporters he was on-scene within minutes and administered CPR to victims. "I immediately entered the school ... and saw three gunshot victims on the ground," he said.

The Los Angeles County Medical Examiner identified the deceased as Gracie Muehlberger, 16, and Dominic Blackwell, 14.

One wounded victim was released from the hospital Thursday night, while a 14-year-old girl and 15-year-old girl who were shot remained hospitalized Friday but were expected to be released in coming days.

Read more at NBC News.

PREVIOUS STORY: A teenage gunman who opened fire at a Southern California high school Thursday morning shot five students, two of whom have died, before shooting himself in the head, officials said.

The suspect, whom authorities described as an Asian male, whose 16th birthday was on the day of the shooting in Saugus High School, was in "grave" condition in a hospital, Los Angeles County authorities said.

Of the two students who died, one was male and the other female. All of the victims and the suspect attend the school in Santa Clarita, north of Los Angeles.

Three other students were also shot in the school's quad before classes began Thursday, Los Angeles County Sheriff Alex Villanueva said during a news conference.

First responders arrived at the school within two minutes of the initial call just after 7:30 a.m., Villanueva said. A .45 semi-automatic pistol with no rounds left in it was recovered from the scene, and investigators are obtaining a search warrant for the suspect's home.

Authorities engaged in an intensive search for the shooter after the gunfire, not realizing immediately that one of the six people wounded was the suspect.

"This is an active shooter situation," a tweet from the Santa Clarita Valley sheriff's office said before the suspect was identified. "If you live in neighborhoods anywhere near Saugus High, PLEASE LOCK DOORS and stay inside. If you see suspect, male dark clothing, in backyards, etc. CALL 911."

"Parents, deputies are on scene everywhere protecting your children," a tweet from the sheriff's office said.

The Santa Clarita Valley sheriff's office tweeted just before 8 a.m. local time that the public should avoid the area of Saugus High School, which is in the county of Los Angeles, about 40 miles north of the city of Los Angeles. Minutes later, the office said people were reporting that shots had been fired at the school.

Student Sharon Orelana Cordova told NBC Los Angeles that she was doing homework when she saw people running so she started running too. "When I got out, I saw this person lying down on the ground, and I saw blood all over. It was really scary, I was really really scared. I didn’t know what was going on," she said.

Saugus was placed on lockdown as were neighboring elementary schools and all of the schools in the William S. Hart Union High School District, officials said.

Aerial video showed students with their hands raised, being escorted by deputies away from the school of about 2,300 students, NBC Los Angeles reported. They were transported from the campus on school buses with armed deputies on board.

An area was set up for parents to reunify with students at a park about three miles from the school.

A statement from Mike Kuhlman, deputy superintendent of the William S. Hart Union High School District, said school officials were "in the process of formulating a plan to care for our school and our community — and will continue sharing updates aswe learn more - including the plan for the days ahead."

"Our hearts go out to the families of those affected by this terrible incident. Words are insufficient in times such as these," the statement said.

Gov. Governor Gavin Newsom said his office was monitoring the situation and in communication with law enforcement.

White House spokesman Judd Deere told The Associated Press that President Donald Trump was also monitoring reports on the incident.