Sheriff Israel later defended his “amazing leadership,” despite Mr. Peterson’s inaction and other questionable decisions by his command staff, which set up a perimeter around the school before it was clear that the shooting was over, instead of moving in on the gunman.

Mr. Peterson was suspended and then resigned his post. In a statement released by his lawyer, he said that he thought the gunfire originated from outside the building, and reacted accordingly by waiting for the suspect there. But a detailed timeline based on radio dispatches and surveillance footage, released last week by the sheriff’s office, suggested that he came to believe the shots might be coming from inside.

In one of his first communications, he said, “Be advised we have possible, could be firecrackers, I think we have shots fired, possible shots fired by the 1200 building.” Later, he said, “We also heard it’s by— inside the 1200 building.”

Mr. Peterson also told other law enforcement officers who raced to the school to stay outside. Coral Springs officers, the first to arrive on the scene, pushed into the building anyway. By then, the gunman had already fled.

Mr. Peterson’s lawyer, Joseph A. DiRuzzo III, did not respond on Thursday to requests for comment on the video.

Nikolas Cruz, 19, a former Stoneman Douglas High student, was later arrested about two miles from the school. He has been charged with 17 counts of murder and 17 counts of attempted murder in the shooting.

The law enforcement response to the shooting was also hampered by the failure of Broward County’s police radio system. The sheriff’s office was unable to connect its radio transmissions with those of the Coral Springs police, who operate on a separate system.