When the gunfire started at a Southern California high school on Thursday morning, many students reached for their phones and started texting.

"Hey mom i don't know whats going on here at school but i love you and im so thankful for everything youve done for me,” a frightened student at Saugus High School in Santa Clarita, Calif., wrote to her mother during a school shooting that killed at least two students. “everyone is saying theres a shooter on campus i dont know whats going on but i love you and dad so much."

"Hey mom i don't know whats going on here at school but i love you and im so thankful for everything youve done for me.” — Text from Saugus High School student

SHOOTING AT CALIFORNIA'S SAUGUS HIGH SCHOOL LEAVES 2 STUDENTS DEAD, SUSPECT IN CUSTODY, OFFICIALS SAY

"I love you baby," her mother Cari Wright wrote back, in texts shared with KABC-TV of Los Angeles. "Stay safe."

Her daughter texted Wright that she was hiding in the music library with other students and later wrote that she thought she was “safe now i think” because they were being escorted out by police.

After Wright was reunited with both of her daughters she told KABC, "I'm very, very happy and grateful for all the school staff that kept our students safe."

SUPREME COURT LETS SANDY HOOK FAMILIES' LAWSUIT AGAINST GUNMAKER PROCEED

Two students – a 16-year-old girl and a 14-year-old boy – were killed and three other teens were injured after a 16-year-old suspect opened fire at the school on Thursday morning.

The shooter was taken into custody after he was found on campus with a self-inflicted gunshot wound to his head.

He also wounded three other students in the attack.

Andrei Mojica was in his Advanced Placement government class when he heard there was an active shooter. The students helped barricade the door – something they’ve practiced before.

“There was just something different about it from a simple drill to real life,” he said, according to The Los Angeles Times.

“We had no clue whether the shooter was on the opposite side of campus or right outside our door,” he said. “That fear made it feel like we were waiting in silence forever.”

“We had no clue whether the shooter was on the opposite side of campus or right outside our door. That fear made it feel like we were waiting in silence forever.” — Andrei Mojica, Saugus High School student

Michael Harrison, who received a text from his 17-year-old younger sister that read, “there is a shooter, call 911” said he couldn’t describe how it made him feel.

“Imagine getting that text,” he told The Times.

Anthony Breznican, who has two grade school-aged children at nearby North Park Elementary told The Times he had just dropped his kids off when his wife called him about the shooting.

He rushed back to the elementary school along with other parents.

“You’ve got kids in little Pilgrim outfits planning to do their Thanksgiving pageant today walking out in tears,” Breznican said.

After student Isabella Perez texted her mom that she thought someone was on campus, her mom told her to get to a classroom.

“I’m so scared I can hear the police,” Isabella, who was already in a classroom, texted. “I love you. I just gonna keep saying it.”

“You’ve got kids in little Pilgrim outfits planning to do their Thanksgiving pageant today walking out in tears.” — Anthony Breznican, parent with children in nearby elementary school

Joy and Bernadette Song Cuan received texts from their freshman son, Karl, that read "DONT WORRY ABOUT ME," "SCHOOL SHOOTING HAPPENED JUST NOW."

His mother texted back, Just pray ok love you...were watching the live news. Daddy is with me."

Bernadette told her son they would pick him up, but he said to wait because he was one of about 20 students left at the school, still hiding in the gym.

“He’s a strong kid, but he’s still so young,” Joy Song Cuan said through tears, according to The Times. “One thing I know for sure — he needs a hug.”

Joy told The Times his son doesn’t like to text ‘I love you’ to him because he thinks it’s "cheesy." On Thursday before they were reunited, a text from his son read, “I love you, too.”

CLICK HERE TO GET THE FOX NEWS APP

Multiple candlelight vigils were held Thursday night for the victims.

The Associated Press contributed to this report.