(FRESNO, Calif.) — A California teenager was arrested on Wednesday in what authorities described as a thwarted possible school shooting.

The unnamed 15-year-old boy — a student at Tranquillity High School, some 30 miles west of Fresno — was charged with illegal possession of a firearm and making criminal threats. He was booked into Fresno County’s Juvenile Hall, according to the Fresno County Sheriff’s Office.

The student was taken into custody after he had allegedly posted threats on social media to shoot up his school. He was apparently upset after recently being involved in a fight at school, the sheriff’s office said.

Members of the community noticed the social media posts on Wednesday and quickly relayed them to school administrators, who then contacted their school resource officer — a deputy with the Fresno County Sheriff’s Office.

That afternoon, deputies went to the student’s home and searched the house. They found a TEC-9 pistol and a magazine in his backpack. They seized the gun and arrested the teen, the sheriff’s office said.

Golden Plains Unified School District released a statement regarding the incident, thanking authorities and community members.

“School safety is a top priority for the district,” the statement read. “We appreciate the work of the Fresno County Sheriff’s Office and are fully cooperating with their investigation. We applaud the community members who chose to speak up and report the concerning social media messages and encourage others to do the same moving forward. Many lives at Tranquillity High School were potentially saved this week.”

Copyright © 2022, ABC Audio. All rights reserved.