Nikolas Cruz Scot Peterson

An armed resource officer who was assigned to protect students and faculty at Marjory Stoneman Douglas High School in Parkland, Florida, was caught on surveillance video hiding from the school shooter.

Scot Peterson resigned in disgrace on Thursday rather than be fired. His resignation came a week after Nikolas Cruz, 19, used a semiautomatic AR-15 assault rifle to kill 17 students and faculty members on Valentine’s Day.

2 of the victims were shot and killed outside the building.

Surveillance video shows Peterson arriving at Building 12 on the school campus during the massacre, but even though he was armed, he never went inside to engage the shooter.

On Thursday, Sheriff Scott Israel confirmed Peterson no longer worked for the Broward County Sheriff’s Office.

Jeff Bell, the president of the Broward Sheriff’s Office Deputies Association, believes Peterson did a good job. Bell reached out to Peterson, even though he wasn’t a member of the union, the NY Post reports.

Bell told The Post that Peterson is “distraught” over the shooting. He said Peterson believed he did a good job by calling the shooting in.

“He believed he did a good job calling in the location, setting up the perimeter and calling in the description [of the shooter],” Bell said.

However, Bell suggested that Peterson’s failure to engage the shooter was a mistake.

“We have to act, even if that means risking our lives to save many many more lives. I would demand that from our union members,” Bell said. “You’re listening to an execution every time you hear the rifle shot.”

Bell said Peterson, a 33-year veteran of the force, was assigned to the school in 2009. He believed the former cop earned about $80,000 annually when he resigned.