Faculty and staff members at Loudoun Valley High School in Purcellville practiced for a frightening scenario Monday with a drill at the school: What would they do if an armed intruder entered the school and started shooting?

It was the first time public safety personnel in Loudoun County conducted a drill involving a shooter in a school with teachers and staff members present, school officials said. Students were not at the school Monday because it was a scheduled teacher workday.

The drill was not prompted by the Dec. 14 shootings at Sandy Hook Elementary School in Newtown, Conn., said Wayde Byard, spokesman for the Loudoun public schools. Byard said that the schools have had emergency drills for about 15 years.

Loudoun Valley Principal Sue Ross said about 140 teachers and other school employees volunteered for the drill, with a dozen teachers in the roles of victims.

The exercise, which took about 90 minutes, showed the need for communication and collaboration among participating agencies, Loudoun Sheriff Mike Chapman said. It also forced teachers to think carefully about what they would do to try to keep students safe.

“The whole idea about this was to identify what we know, how we will respond . . . to look at where we might fall short, and then how do we fix that,” Chapman said.

Chapman said the sheriff’s office prepared for the drill for several months, along with the Virginia State Police, town police departments and the county’s Department of Fire, Rescue and Emergency Services.

“In the past, we’ve had lockdown scenarios done at the school, and we’ve had fire alarms and so forth, but we’ve never had a coordinated effort involving so many agencies as it would happen in real life,” Chapman said.

In the drill, public safety and school personnel practiced responding to a gunman entering the school through a back door. In the scenario, the gunman killed three teachers and wounded nine others. The intruder also dropped several explosive devices, one of which exploded and killed a sheriff’s deputy. The exercise ended with the gunman committing suicide after deputies cornered him in a classroom.

“When you start hearing the sirens and you start seeing the sheriff’s vehicles show up, the lights going and the adrenaline . . . the first impression I had was how real it felt,” Chapman said.

“Your adrenaline level went up from zero to 60 in an instant,” said Ned Waterhouse, Loudoun deputy school superintendent, who observed the drill. “This is a very complex undertaking. What I saw today suggests to me that it is no small feat to respond to an event of this magnitude, this gravity.

“The other thing that really comes through is how big a high school is,” Waterhouse said. “It’s an enormous physical plant, and to go through an entire high school and clear that building is an immense undertaking.”

Stephen Varmecky, who teaches business and marketing at the school, said that teachers are trained to lock the classroom door, turn out the lights and move students away from the door, preferably to an interior room.

Although faculty members had previously trained “in a vacuum,” teacher Marcia Owens said, it was a different experience having public safety personnel in the building and hearing unknown people knocking on the locked classroom door.

“There were several incidents like that where we had to judge, ‘What do I do in this situation?’ ” Owens said. “It was also very helpful to hear . . . that the police officer would have keys to our rooms and would come to clear the rooms, and that would take time.”

Waterhouse said he would like to have similar drills in other county schools.

“This is the kind of scenario that needs to be practiced several times in order to sufficiently work through all of the loose ends and the bugs,” he said.

“And, especially, I go back to the issue of communication. You’re bringing multiple agencies together, and everybody has their own protocols. All of that has to be figured out.”