The sheriff’s deputy who was on campus during the Florida high school massacre but did not confront the gunman declined to testify on Thursday before a state commission investigating it.

Former Broward County deputy Scot Peterson failed to appear before the Marjory Stoneman Douglas High School Public Safety Commission, where he would have been asked why he did not enter the building where 14 students and three staff members died on February 14 to try to stop the gunman.

Instead, his lawyer Joseph DiRuzzo appeared and told the 14-member panel and the packed crowd that he had filed a lawsuit earlier on Thursday to quash the panel’s summons.

He dropped a copy of the lawsuit on the lectern, turned and left.

One victim’s father said to DiRuzzo as he passed: “He didn’t do his job. My daughter should be alive.”

The gallery section for the victim’s families was packed, not only for Peterson but to hear from Broward school superintendent Robert Runcie and sheriff Scott Israel, who were testifying later.

There had been speculation Peterson might invoke the Fifth Amendment and refuse to testify, as a criminal investigation of law enforcement’s response continues.

Security video from the shooting shows that Peterson arrived outside the three-storey building as the gunman killed 11 people on the first-floor.

Peterson drew his gun, but retreated to cover next to the neighbouring building.

The video shows Peterson never left that spot for 50 minutes, even after other deputies and police officers arrived on campus and went inside.

The panel’s members believe Peterson could have saved the five students and one teacher killed on the third floor if he would have gone into the building and confronted suspect Nikolas Cruz.

Some called him a “coward” and “not a real cop” during their Wednesday meeting.

Pinellas County sheriff Bob Gualtieri, the panel’s chairman, said Thursday he wanted to ask Peterson: “Why the hell did he go hide and run away and not do his job.”

Peterson, a decorated 32-year veteran of the sheriff’s office, told investigators and in interviews with the Today show and The Washington Post last spring that he heard only two or three shots and did not know whether they were coming from inside or outside the building.

That is contradicted by radio calls in which he correctly identifies the building as the gunman’s location.

Bullets also came out of a window almost directly above where he took cover.

About 150 shots were fired from an AR-15 semi-automatic rifle. The shots were heard by others a quarter of a mile away.

Peterson, 55, retired shortly after the shooting rather than accept a suspension while an internal investigation was conducted. He is receiving a 100,000 dollar (£78,000) annual pension.

Cruz, a 20-year-old former Stoneman Douglas pupil, is charged with the killings.

He has pleaded not guilty, but his lawyers have said he would plead guilty in exchange for a life sentence. Prosecutors are seeking the death penalty.