West High School in Southwest Bakersfield was put on lockdown for 20 minutes Thursday afternoon.
Police were chasing a suspect in the area after stopping a vehicle on Valhalla Drive around 2 p.m.
Officials chased the driver, who dropped a firearm, on foot and arrested him. The passenger escaped.
The driver was 19-year-old Benjamin Wycuff who was booked into Kern County Jail Central Receiving Facility for possessing a loaded firearm in public, resisting arrest, and participating in a street gang.
Anyone with information on the case is asked to call BPD at 661-327-7111.