The freshman walked in through the north side of Loudoun County High School shortly after 8 a.m. Wednesday carrying a large, metallic pair of headphones, his unceremonious entrance captured on a surveillance camera.

Elsewhere in the building, a security specialist keeping close watch on the cameras on a monitor saw something else: a flash of metal that looked as if it could be a gun. She called police.

Within minutes, a message was broadcast over loudspeakers telling students and staff at the Leesburg school to lock doors and move into interior rooms. Leesburg police arrived with tactical teams to sweep the campus and traced the young man’s path through the school with the same cameras, finding him in the cafeteria. They continued an extensive search of the school, declaring it cleared by about 9:20 a.m.

“She believed it was a handgun, but it turns out it was headphones,” said Lt. Jeff Dube, a spokesman for the Leesburg Police Department. “That’s what precipitated it. Fortunately it was a false alarm.”

Schools spokesman Wayde Byard said that although the event may have sparked an unnecessary “adrenaline rush,” officials were heartened that students, staff and police followed protocol.

“It turned out to be a tremendous on-site live drill,” he said. “It really became apparent that everybody did exactly what they were supposed to do.”

That included the security specialist, who called police immediately after seeing the student with the headphones walking onto campus.

Byard said the headphones “looked amazingly like a gun” and that it appeared as though the student was brandishing it with the muzzle pointed toward the ground.

It also included students and staff, who secured doors and crowded into supply closets, Byard said, as they’re directed to during drills.

As police combed the building, they knocked on doors and checked on every classroom, per protocol, he said, even after the student who had unknowingly sparked the lockdown was found with headphones.

Police located that student in the cafeteria by tracing his movement using security footage. The high school campus has 47 cameras, which monitor hallways, entrances and the parking lot.

About a quarter of the school’s students and half of the staff were on campus at the time because the school day doesn’t start until 9 a.m. Students who later arrived on foot were sent to nearby Catoctin Elementary School or Monroe Technology Center.

Staff at the elementary school also locked classroom doors but did not have a full-fledged lockdown.

Byard said past tragedies inform the school’s security practices, and security specialists are told not to wait if they see something that looks like a gun because school shootings can unfold quickly.

Lockdowns at the high school are rare, Byard said. One took place in August, when someone called to report a crime near the school, but it turned out to be a hoax. Before that, there had not been a lockdown in about a decade.

Classes resumed normally after the lockdown was lifted, Byard said. The freshman with headphones was questioned by police but “did nothing wrong,” he said.