Image copyright Broward County Sheriff Image caption Scot Peterson was charged with child neglect after he failed to confront an active school shooter

The arrest of a school police officer who failed to confront a gunman at a high school in Parkland, Florida, has opened a debate over what kind of punishment would be fair. Should he really be put behind bars for decades?

Former Deputy Scot Peterson, 56, stood outside building 1200 on the campus of Marjory Stoneman Douglas High School for 48 minutes as rifle shots rang out from within during the 14 February 2018 massacre.

The attack claimed the lives of 17 people and left 17 more injured.

For his apparent inaction, and for warning other responding officers not to approach, Mr Peterson was widely vilified by parents of victims, law enforcement officials and President Donald Trump who claimed that he "doesn't love the children".

Fifteen months later, the 30-year veteran - who worked at the school for nine years and resigned days after the attack - has been charged with seven counts of child neglect with great bodily harm, three counts of culpable negligence and exposure to harm, and one count of perjury.

He is now facing up to 97 years in jail.

While many say his behaviour reveals a moral failure, many legal experts are questioning what exactly the former deputy's responsibility was to the children that day and whether prosecutors will be able to prove child neglect in court. Others say he is being made a scapegoat.

What is he accused of?

Florida Department of Law Enforcement Commissioner Rick Swearingen, who has been leading an investigation into the deaths, said that "former Deputy Peterson did absolutely nothing to mitigate" the carnage that day.

"There can be no excuse for his complete inaction and no question that his inaction cost lives," he said in a statement as the charges were filed.

Mr Peterson was the closest person to the gunman, former student Nikolas Cruz, but did not arrive outside the building until it was too late to prevent the deaths of 11 people on the ground floor of the school building, investigators say.

Media playback is unsupported on your device Media caption School surveillance camera shows deputy waiting outside

But if he had acted, by confronting the killer rather than taking cover, he could have saved people on the third floor, some parents contend.

"He should rot," said Fred Guttenberg, whose 14-year-old daughter Jaime was killed as a bullet ripped through her spinal cord while she fled for her life.

"My daughter was one of the last to be shot. My daughter absolutely could have been saved by him and she wasn't," he said, adding: "Had she had one more second she would have been saved."

According to the arrest warrant, Mr Peterson made false statements when he told investigators that he only heard two or three gunshots, when in reality, the gunman fired around 75 times after Mr Peterson had arrived.

What do investigators say?

"It's never too late for accountability and justice," Broward Sheriff Gregory Tony said after firing Mr Peterson, adding in a statement that his "failure to act" during the massacre "clearly warranted both termination of employment and criminal charges".

Pinellas County Sheriff Bob Gualtieri, who chairs a public safety commission for the school of 3,200 pupils, called Mr Peterson "a coward, a failure and a criminal".

"There is no doubt in my mind that because he didn't act, people were killed."

According to Florida law, prosecutors must establish that Mr Peterson was the legal caregiver to the the child victims, prove that his inaction exposed them to harm and also that he did so due to a "reckless disregard for human life".

Media playback is unsupported on your device Media caption Trump: "I would have run in even if I didn't have weapon"

'Spurious charges'

Mr Peterson's lawyer, Joseph DiRuzzo III, called the charges "a thinly veiled attempt at politically motivated retribution against Mr Peterson".

"We will vigorously defend against these spurious charges that lack basis in fact and law," he said, adding that it is a "gross over-simplification" to describe his client as cowardly, as he believed the gunshots were being fired somewhere outside the building.

He also argued that Mr Peterson cannot be prosecuted as a caregiver, because he was officially acting in a law enforcement capacity.

In an interview with NBC News in June 2018, Mr Peterson defended his actions, saying: "The families need to know, I didn't get it right, but it wasn't because of 'I don't want to go into the building (or) I don't want to face somebody in there... It wasn't like that at all."

"I never thought even for a moment of being scared or a coward because I was just doing things the whole time. It never entered my mind," he added.

About 18 months before the shooting, Mr Peterson attempted to have the accused gunman forcibly committed to a mental hospital, according to US media, but his request was overruled by school health officials.

Could he have made a difference?

Eugene O'Donnell, professor at John Jay College of Criminal Justice and a former New York Police Department (NYPD) officer, told Florida's Sun Sentinel newspaper that the charges are built on the presumption that Mr Peterson could have thwarted the killings.

"Criminalising someone for not acting in the middle of a mass murder is built on the preposterous notion that police officers are Navy SEALs in disguise that can spring into action," Mr O'Donnell said. "You never know what you're going to do when the bullets start flying."

John Baeze, an expert witness for police-related court cases for NYPDTruth.com and a former NYPD police detective now living in Florida, said the school officer had "not only a moral duty, but a departmental duty" to act.

Even an armed civilian who just happened to be in the area would have felt obligated to intervene, he tells the BBC, adding: "This man was in uniform, with a firearm, on duty, at the school for the very purpose of protecting the children. And he did not go in."

He blames Mr Peterson's "reprehensible" actions that day on "a culture that is pervasive in police departments across the United States where it is 'officer safety first, citizen second'."

He adds that this mentality has led to "shoot first, ask questions later cases" in which police have unnecessarily killed suspects.

Jeff Bell, the president of the Broward Sheriff's Office Deputies Association union, says the officer is not a coward, but as the attack unfolded, "he absolutely crumbled and he froze" due to his "lack of training and his lack of inner will".

He says the county has failed to provide officers with an active shooter practice space, a gun range or a driving range - training facilities that are available to other police officers in Florida.

In regards to child neglect, he says that the law shows that only "caretakers" can be held responsible for that crime, and that he has seen cases were babysitters or siblings could not be charged for domestic violence because a custodial relationship could not be proven.

"A school resource deputy is not a caretaker. They're a police officer assigned to a school. We have no more care on a campus than a teacher would," he says, adding that is unrealistic for a school officer to be considered a caretaker for every child on campus.

"In the future, does that mean that if we're working an off duty detail at a movie theatre and there happens to be a shooting and there are children in there, does that mean we're all automatically a caretaker?

"And where does it stop? Does that mean that a firefighter that does not go into a building fast enough is going to be charged with neglect? Or a nurse who failed to triage someone properly? So it's a very slippery slope."

Nikolas Cruz, who has admitted to the attack, faces the death penalty and is due to go on trial in early 2020.

More on school security:

Media playback is unsupported on your device Media caption Armed teacher: "I fear killing an innocent student"