The sheriff’s deputy who was assigned to the Florida school where a gunman killed 17 people last week has left the force after evidence showed he stood outside the building where the shooting occurred rather than going in, Sheriff Scott Israel said Thursday.

“He never went in,” Sheriff Israel said, describing video footage of the scene he had watched.

Asked what school resource officer Scot Peterson, who was the only armed security guard at the school, should have done, the sheriff said he should have gone into the building, “addressed the killer, killed the killer.”

This is the latest in a series of lost opportunities to stop Nikolas Cruz, the accused gunman at Marjory Stoneman Douglas High School in Parkland, Fla., either before or during the attack. The Federal Bureau of Investigation last week said a specific tip identifying Mr. Cruz’s threat in January fell through the cracks.

Two unnamed Broward County deputies also have been placed on restricted duty while the department explores what could have, or should have, been done when police responded to calls regarding Mr. Cruz before the shooting, Sheriff Israel said.