CLAYTON, N.C. (WNCN) — A weapons detection system at Clayton Middle School led to a man being charged on Wednesday with having a gun on school property, according to the Clayton Police Department.

On Wednesday at 12:30 p.m., police said a man entered Clayton Middle School to pick up his sisters that were being dismissed early by the school.

After showing identification, Ubaldo Tellez Perez, 21, of Clayton, was allowed into the school and walked through the weapons detection system installed by the Johnston County Public School System.

The system alerted that Perez was possibly carrying a weapon on the left side of his front waistband. When the weapons detection system went off, Clayton Middle School staff asked Perez if he was carrying a weapon and Perez told them that he was.

The School Resource Officer approached Perez and secured a Glock 9MM handgun. Perez was taken into custody and was charged with possessing a weapon on educational property and carrying a concealed weapon.

Perez acknowledged that he did not realize that he was carrying his gun when he walked into the school.

Police said no students or staff were in danger during the incident.