Officials at South Pasadena High School notified police after learning of the teens' plot to "kill three staff members and as many students as possible with firearms."
South Pasadena Police detectives said in a statement they were able to obtain enough evidence upon executing search warrants at the students' homes to arrested the students, and while one was taken into custody without incident, the other resisted.
The student, identified as male, attempted to flee, but was eventually caught, they said.
"This is a prime example of school officials recognizing suspicious behavior. It was this information that helped prevent a horrific tragedy," Sgt. Brian Solinsky said in the release.
Geoff Yantz, superintendent of the South Pasadena Unified School District, thanked police for stopping a "potential mass shooting" in a note to parents and employees.
"The police have the situation under control and there is currently no threat to students or employees," Yantz said. "The School Board and I appreciate the immediate response by the South Pasadena Police Department, and school will begin on as planned" on Thursday.
As the news of the arrests spread in the community, people took to Twitter to share their disbelief -- and gratitude for heads-up action on the part of school officials and law enforcement.
@SoPasPD Thanks for keeping us safe!— Sean Riffle (@SeanRiffle) August 19, 2014
As much as we hate on the south pas police, they just saved a lot people— Andrew Garfield (@Andrewwwonggg) August 19, 2014
It's scary to think someone who we all go to school with would want to cause this much suffering— han san (@hannah_sanders_) August 19, 2014
I'm in disbelief after hearing about those kids from south pas. thank god it was stopped before it became a reality— kelly nathan (@kellie_natham) August 19, 2014
I can't believe people at South Pas could want to do such a thing— Ken (@Kenrc122) August 19, 2014