A federal judge says Broward schools and the Sheriff’s Office had no legal duty to protect students during the shooting at Marjory Stoneman Douglas High School.

U.S. District Judge Beth Bloom dismissed a suit filed by 15 students who claimed they were traumatized by the crisis in February. The suit named six defendants, including the Broward school district and the Broward Sheriff’s Office, as well as school deputy Scot Peterson and campus monitor Andrew Medina.

Bloom ruled that the two agencies had no constitutional duty to protect students who were not in custody.

“The claim arises from the actions of [shooter Nikolas] Cruz, a third party, and not a state actor,” she wrote in a ruling Dec. 12. “Thus, the critical question the Court analyzes is whether defendants had a constitutional duty to protect plaintiffs from the actions of Cruz.

“As previously stated, for such a duty to exist on the part of defendants, plaintiffs would have to be considered to be in custody” — for example, as prisoners or patients of a mental hospital, she wrote.

Peterson was the only armed person at the school when Cruz showed up with an AR-15 rifle and murdered 17 people, in addition to wounding 17 more. Peterson has been widely vilified for taking refuge outside the school and not confronting Cruz.

“His arbitrary and conscience-shocking actions and inactions directly and predictably caused children to die, get injured, and get traumatized,” the lawsuit claimed.

Medina knew Cruz and saw him arrive on campus, but did not confront him.

The lawsuit argued that the Sheriff’s Office and School Board “either have a policy that allows killers to walk through a school killing people without being stopped. Alternatively, they have such inadequate training that the individuals tasked with carrying out the policies … lack the basic fundamental understandings of what those policies are such that they are incapable of carrying them out.”

Kristoffer R. Budhram of Jacksonville, who represented the students, said in an emailed statement: “We respectfully disagree with Judge Bloom's decision to dismiss our clients' case. This case is about protecting the Constitutional rights of individuals who were the victims of one of the worst mass shootings in this country’s history.

“We are exploring all of our options for ensuring that they get their day in court, including appealing Judge Bloom's decision," Budhram wrote.

Bloom’s ruling contrasts with the action of a Broward County judge last week.

Englander Henning found that Peterson had a duty to the school community as someone whose job was security and who had an “obligation to act reasonably” under the circumstances of the shooting.

The judge also found Peterson was not protected from the lawsuit by “sovereign immunity,” a legal doctrine that shields public employees from legal action based on their official conduct.

Joel Perwin, Pollack’s attorney, said: “We don’t think it's even debatable that Peterson had a duty to these students. Peterson’s disclaimer of any legal responsibility is a mirror of his abdication of his responsibility for these kids,” he said.