SANTA CLARITA, Calif. - A student pulled a gun from his backpack and opened fire at a Southern California high school Thursday, killing two students and wounding three others before shooting himself in the head on his 16th birthday, authorities said.

The attacker was hospitalized in critical condition, officials said, and investigators offered no immediate motive.

The gunfire began around 7:30 a.m. at Saugus High School in the Los Angeles suburb of Santa Clarita. Authorities estimated that the suspect took just 16 seconds to pull out the weapon, shoot five classmates and turn the gun on himself.

At the time, students were “milling around” and greeting each other in an outdoor quad area, sheriff’s homicide Capt. Kent Wegener said. Surveillance video showed the shooter standing still while “everyone is active around him.”

“He just fires from where he is. He doesn’t chase anybody. He doesn’t move,” Wegener said.

The suspect appeared to fire at whoever was in front of him. He had no known connection to those he shot, Wegener said.

Video showed the last thing the assailant did was shoot himself with the final bullet in the .45-calibre handgun, Wegener said. The weapon was empty when it was recovered.

A 16-year-old girl and a 14-year-old boy died.

Two girls, ages 14 and 15, were each in good condition after being treated for gunshot wounds, according to Patricia Aidem, a spokeswoman for Providence Holy Cross Medical Center.

A 14-year-old boy was treated and released from another hospital, authorities said.

Sheriff Alex Villanueva said the shooter was a student at the school but did not identify him.

The sheriff said a biography on an Instagram account reported as possibly belonging to the teen contained the posting: “Saugus, have fun at school tomorrow.”

The message was discovered Thursday morning after the shooting. It was unclear when it was made and by whom, the sheriff said.

It was later removed, and investigators do not know who made the change, Wegener said.

Investigators were searching the suspect’s home. Wegener said the sheriff’s department had not received any recent calls to the boy’s house “that would indicate that there was turmoil” there.

The teen’s father died two years ago. Two years before that, the father had been arrested amid a domestic dispute with the boy’s mother.

Fellow students and a neighbour say he was a Boy Scout who was smart, quiet and gave no indication he would become violent. One girl who knew him for years said he wasn’t bullied and had a girlfriend.

“At this point in time, we have no indication of motivation or ideology,” said Paul Delacourt, the agent in charge of the FBI’s Los Angeles field office. Santa Clarita is a city of more than 200,000 about 30 miles (48 kilometres) northwest of downtown LA.

The sound of gunfire sent some students running while others and staff followed recently practiced security procedures.

Kyra Stapp, 17, was watching a documentary in class when she heard two gunshots. Panicked students ran in and reported the shooting.

Stapp’s class and others were herded into a teacher break room where they locked the door and turned off the lights.

Kyra texted her mother and tried not make any noise. They exchanged messages as sirens screamed and helicopters and deputies carrying rifles and shotguns swarmed the campus. Then Kyra fell silent while officers escorted students out.

“She’s been texting me and all of a sudden she’s not,” Tracy Stapp said. “That was like the worst 10 minutes of my life, I swear.”

Loading... Loading... Loading... Loading... Loading... Loading...

Shauna Orandi, 16, said she was in her Spanish class doing homework when she heard four gunshots that she initially mistook as instruments from a band class. She said a student burst into the room saying he’d seen the gunman, and her classmates were stunned into silence.

“My worst nightmare actually came true,” she said later as she left a nearby park with her father. “This is it. I’m going to die.”

Freshman Rosie Rodriguez said she was walking up the library stairs when she heard noises that sounded like balloons popping. She realized they were gunshots when she saw other students running.

Still carrying a backpack laden with books, she ran across the street to a home, where a person she didn’t know gave shelter to her and about 10 other students.

“I just heard a lot of kids crying. We were scared,” Rodriguez said.

A huge crowd of anxious parents gathered in the park, waiting to be reunited with their children.

Undersheriff Tim Murakami tweeted an apology to the parents, saying investigators needed to interview the students before they could be released.

Orandi said she has heard about so many school shootings that she always assumed she’d panic. But she stayed calm with the help of her teacher, who locked down the classroom.

Saugus High’s security is provided by one unarmed sheriff’s deputy and nine “campus supervisors” who act as guards, said to Collyn Nielson, chief administrative officer for the William S. Hart Union High School District.

The campus is surrounded by a fence, and students enter through a limited number of gates each morning. There are a dozen security cameras but no metal detectors.

All district schools hold lockdown drills three times a year, including two in the fall that have already occurred, Nielson said.

“In speaking with staff and hearing reports, students reported they knew what to do and immediately went into lockdown mode,” he said.

___

Antczak reported from Los Angeles. Associated Press writers Christopher Weber, Brian Melley and Justin Pritchard in LA also contributed to this report.