Police arrested a student with a loaded gun in his backpack at a Walnut Creek high school on Thursday, prompting a lockdown, officials said.

Officers responded to a report around 11:13 a.m. that a student at Las Lomas High School, located at 1460 S. Main Street, had a concealed handgun, according to Walnut Creek police.

The on-campus school resource officer located and detained the student. Officials found a loaded handgun when they searched the student’s backpack.

The school went on lockdown until police determined that the campus was safe.

The student — who officials did not identify because of their age — was arrested and taken to the police department for possession of a loaded firearm.

Anna Bauman is a San Francisco Chronicle staff writer. Email: anna.bauman@sfchronicle.com Twitter: @abauman2