Visalia police were called to Willow Glen Elementary School on Akers and Hurley Avenue following reports of a man with an assault rifle.
The school was placed on lockdown and the man was detained.
The rifle turned out to be an airsoft gun.
The suspect has been identified as 21-year-old Edward Woodard and will be booked in the Tulare County Adult Pre-Trial Facility.
The lockdown has been lifted, and police say there is no ongoing threat to the school.