A federal judge has ruled that schools and sheriff's officials in Broward County, Florida, had no constitutional duty to protect students during the Feb. 14 shooting massacre at Marjory Stoneman Douglas High School that left 17 dead and wounded 17 others, reports the Sun-Sentinel.

U.S. District Judge Beth Bloom dismissed a suit filed by 15 students against six defendants, including the Broward school district, the county sheriff's office and Scot Peterson, the embattled deputy who failed to confront gunman Nikolas Cruz as shots rang out.

The lawsuit accused the defendants of violating the students' rights under the 14th Amendment, which disallows deprivation of life, liberty and property without due process. Bloom, however, ruled the students would have to be considered in custody for officials to be constitutionally required to protect them from Cruz.

Scot Peterson, a former Broward County Sheriff's deputy, never entered Marjory Stoneman Douglas high school during a Valentine's Day mass shooting that left 17 dead CBS Miami

The lawsuit said Peterson's "arbitrary and conscience-shocking actions and inactions directly and predictably caused children to die, get injured, and get traumatized," arguing that sheriff's and school officials "either have a policy that allows killers to walk through a school killing people without being stopped" or "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."

Get Breaking News Delivered to Your Inbox

The lawsuit claimed Superintendent of Broward County Schools Superintendent Robert Runcie and Broward County Sheriff Scott Israel were well aware of the potential danger the shooter posed and a lack of security at the school but "chose not to fix it," reported CBS affiliate WPEC.

"We didn't deserve that. We were just students and we thought we were safe at school and we didn't need that to happen to us," former student Audrey Diaz told the station in January following the filing of the suit.

Bloom ruled the 14th Amendment generally provides due process protection from state actors, not third parties.

"The claim arises from the actions of Cruz, a third party, and not a state actor," Bloom wrote in a Dec. 12 ruling. "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."

The ruling comes a week after Broward Circuit Judge Patti Englander Henning last week, who rejected Peterson's claim that he had "no legal duty to protect students and faculty" when she refused to dismiss a negligence lawsuit filed by Andrew Pollack, whose daughter Meadow was killed in the attack. Henning found Peterson had an "obligation to act reasonably" in his capacity as an officer at the school during the shooting.

A memorial for Meadow Pollack, one of the victims of the Marjory Stoneman Douglas High School shooting, sits in a park in Parkland, Florida on February 16, 2018. Rhona Wise / AFP/Getty Images

Pollack said it made no sense for Peterson's attorneys to argue a sworn law enforcement officer with a badge and a gun had no requirement to go inside.

"Then what is he doing there?" Pollack said after the ruling. "He had a duty. I'm not going to let this go. My daughter, her death is not going to be in vain."

Peterson's attorney, Michael Piper, said he understands people might be offended or outraged at his client's defense, but he argued that as a matter of law, the deputy had no duty to confront the shooter. Peterson did not attend the hearing.

"There is no legal duty that can be found," Piper said. "At its very worst, Scot Peterson is accused of being a coward. That does not equate to bad faith."

Piper has said he would appeal the ruling.

Cruz 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.