A file photo of Wilson High School.

A student at Wilson High School was arrested Thursday around 1 p.m. after administrators discovered he was carrying a loaded gun, according to authorities.

Police didn’t explain what they think the student was doing with the gun, but school district spokesman Chris Eftychiou said he didn’t threaten anyone.

“The preliminary investigation revealed that there were no immediate threats of safety,” police spokeswoman Shaunna Dandoy said.

Police arrested the student, 18-year-old Erick Alvarez, on suspicion of possessing a firearm at a public school, carrying a concealed weapon, possessing marijuana on school grounds, possessing a controlled substance, and possessing a controlled substance with intent to sell, Dandoy said.

“This student will not be returning to Wilson,” the district said in a notification sent to parents. “Any student who brings a weapon to school should expect to face very serious consequences. Such behavior will not be tolerated.”

It wasn’t immediately clear how school officials discovered the gun. Authorities said Alvarez admitted to having it after an administrator detained him.

“One of the most effective deterrents is to have thousands of students, staff and parents on the lookout for anything that might compromise school safety,” the notification to parents said.

Alvarez was being held on $50,000 bail, according to police.

Valerie Osier is the Social Media & Newsletter Manager for the Long Beach Post. Reach her at [email protected] or on Twitter @ValerieOsier