GRAPEVINE, Texas (CBSDFW.COM) – Grapevine High School went on lockdown Friday afternoon after a student posted an image on Snapchat of an individual with a gun in his waistband in the Grapevine High School cafeteria.

The gun was later found in a student’s backpack and police took four students into custody.

READ MORE: Nebraska Sending State Troopers To Help At Southern Texas Border

At 1:40 p.m., Grapevine-Colleyville ISD tweeted police were on campus and, “All staff and students are safe and behind locked doors.  No one will be allowed in the campus.  Please do not go to the campus at this time.”

The district tweeted at 2:15 p.m., “We received a report of a student with a gun at GHS. Police conducted a thorough sweep of the building and all individuals involved are detained. The gun was found and has been secured by officers. We will continue in a lockdown until law enforcement has given the all clear.”

Grapevine High School on lockdown (CBS 11)

During the investigation, officers discovered the loaded pistol in another student’s backpack.  

Four people were taken into custody: two 17-year-old boys, one juvenile boy, and one juvenile girl.  

Charges include terroristic threat, criminal trespass, possession of a firearm in school zone and possession of marijuana.

There was a lockout at Timberline Elementary School, Cross Timbers Middle School and the GCISD Swim Center, but it was lifted around 2:20 p.m.

The lockdown at the high school was lifted at 2:40 p.m. and students were dismissed early.

“Once the image was posted on Snapchat, a student immediately notified a teacher and administrator, and swift action was taken to ensure the safety of our students and staff. Simultaneously, a different student was sharing the information with the GHS School Resource Officer. We continually encourage our students that if they see something, to say something, and this is why that is so important. I want to thank the brave students who brought this to the attention of GHS staff. I also want to thank the Grapevine and Colleyville Police Departments for their swift responsiveness this afternoon,” Superintendent Dr. Robin Ryan said in a news release Friday evening.

MORE NEWS: Shooting Near Banquet Hall In Dallas Leaves 8 Injured, Including 2 Children

Counseling support was on hand for students who requested it and it will be available Monday at the school as well.