TAMPA, Fla. (WFLA) — A 14-year-old student was found with a loaded gun at Palmetto High School on Friday, the Palmetto Police Department announced.

The student was reportedly attempting to avoid a weapons detection system at one of the school’s access points when the school guardians approached and disarmed the student.

The student told police he had the gun to protect himself when he walked to and from school and was taken into custody by the Palmetto Police Department.

Police said the student is being charged with possession of a firearm on school campus.