Lompoc Valley Middle School was put on lockdown Monday morning after a citizen reported seeing a juvenile headed to the school with a semi-automatic handgun in the backpack.
Lompoc police Sgt. Chuck Strange said officers responded to the scene about 7:45 a.m., and lockdown procedures were put in place at 8:15 a.m.
Strange said the caller told police that the 13-year-old boy pulled the gun from his backpack and said he was taking it to the school for protection.
The teenager was identified with the assistance of school staff, according to Strange.
He said the student was cooperative and his backpack was searched, and he was found to be in possession of a pellet gun.
The boy was taken into custody for possessing a weapon on school grounds. Strange said he was booked into the Lompoc City Jail and released to his parents.