PARKLAND, Fla. – The Broward Sheriff's Office has released surveillance video that shows a school resource deputy failing to enter the building where a former student killed 17 people and wounded more than a dozen others last month at Marjory Stoneman Douglas High School.

Broward County Judge Jeffrey Levenson ruled Monday that the BSO had to release the video within 24 hours of Thursday's noon deadline to appeal.

Several media organizations sued the BSO and Broward County Public Schools for the release of the video recordings from the exterior of the Parkland school.

Sheriff Scott Israel said Scot Peterson, a school resource deputy assigned to the campus, resigned after he failed to engage shooter Nikolas Cruz.

Israel said Peterson "never went in" to building 12 while Cruz used an AR-15 rifle to kill 14 students and three teachers during the Feb. 14 mass shooting. The sheriff said Peterson got on his radio and stayed where he was "for upwards of four minutes." He said Peterson "clearly" knew there was a shooter inside.

The video shows Peterson standing near the entrance to the building. He doesn't appear to be doing anything.

One man comes into frame and is seen running inside, but Peterson remains outside.

"The video speaks for itself," the BSO said in a statement. "His actions were enough to warrant an internal affairs investigation, as requested by Sheriff Scott Israel on Feb. 21."

President Donald Trump called Peterson a coward, but Peterson, through his attorney, said he wasn't sure where the gunfire was coming from and that he was "no coward."

The BSO last week released a detailed timeline of events based on 911 calls and dispatch communications that were made during the shooting. The records show it took law enforcement officers more than 11 minutes to enter the building after the first shots were fired.

Levenson ruled that the BSO and prosecutors failed to meet the burden of establishing that the recordings were part of an active investigation that would merit an exemption under the state's public records law.

Attorneys for the school board argued that the release of the video could compromise the school's security system, but Levenson ruled that "the potential harm to the current security system, at best, is outweighed by the strong public interest in disclosure."

Israel offered no further comment about the video.

"In accordance with Florida law, we are prohibited from discussing any other details of the IA investigation until the case has concluded," the BSO said.