In 2014, a South Carolina father allegedly did the unthinkable.

Timothy Jones, 34, is on trial for the murders of his five children. According to officials, he picked them up from day-care and then strangled four of them—one after another—with his bare hands until they were dead. The fifth he beat to death.

He allegedly placed the little bodies of Merah, 8, Elias, 7, Nahtahn, 6, Gabriel, 2, and Abigail, 1, in black plastic bags and drove for days, over 700 miles, to dump their remains in a shallow ditch in Alabama.

The crime Mr. Jones is charged with—for which prosecutors are seeking the death penalty—is horrific, and compounded by the possibility that it could have been prevented. Believing that to be the case, the children’s mother, Amber Jones, 31, is suing the South Carolina Department of Social Services (DSS), alleging the agency “failed to provide the statutorily mandated protection that would have saved [her children] from abuse and neglect and prevented their deaths.”

Ms. Jones’s complaint seeks unspecified damages from the state DSS, calling the Lexington County agency “grossly negligent,” in its multiple interactions with the Jones family leading up to the murders. The organization failed to fully investigate multiple allegations of abuse, from teachers, school officials, neighbors, babysitters, and Amber Jones herself, according to the complaint. When investigations uncovered abuse, the DSS made a half-dozen ineffectual “safety plans,” instead of reporting evidence of child abuse to the authorities and removing the children from Mr. Jones’s care.

When reached by phone Wednesday, a spokesperson for South Carolina’s Department of Social Services said, “We aren’t commenting at this time.”

The complaint, filed in Richland County on Friday, details Mr. Jones’s alleged crime and the lead-up to it, in a way previously unknown because of a court-imposed gag order on his murder trial.

According to the new complaint, Timothy Jones—a former Navy man with a history of substance abuse and a stint in prison for drug possession, forgery, burglary, and car theft—married Amber Jones when she was 19 years old. They had their first child in 2006 and soon had three children within three years’ time.

In 2011, DSS started to receive complaints about the Joneses.

The kids were filthy, trash and power tools were strewn around the home, and Mr. Jones was threatening to shoot a neighbor’s dog, according to the DSS reports referenced in the complaint. Mr. Jones lashed out at a DSS caseworker and accused the agency of “ruining people’s lives.”

From 2011 to 2012, the county DSS made multiple visits to the home, but failed to follow up on safety plans. By May 2012, Mr. Jones was displaying signs of a violent nature, according to the complaint.

Mr. Jones threatened to “snap” his wife’s neck in front of their children and shoot his neighbors. Once, Ms. Jones alleges, her husband “played chicken” with an 18-wheeler with her and the children in the car. On the same occasion, she says he head-butted her and spit in her face.

Ms. Jones says she filed a domestic violence report with the sheriff and informed her DSS caseworker about the report as well as other instances of alleged violence around the home that she hadn’t told law enforcement about.

In June, Mr. Jones discovered his wife was having an affair, according to divorce records, and took the children to his parents’ home in Mississippi without Ms. Jones’s consent. When Ms. Jones called the DSS caseworker, she says she was told to contact a family lawyer.

Timothy and Amber Jones divorced in 2013. In his divorce complaint, Mr. Jones argued his wife’s “lifestyle” and her inability to care for the children made her unfit. He said she was having an affair with a much younger neighbor and would leave the children alone after she put them to bed to spend the night at her new boyfriend’s home. Mr. Jones noted the Department of Social Services had investigated his wife and found that she maintained a “sloppy” home, but didn’t mention his own record with DSS. It’s unclear whether Amber Jones had an attorney to plead her case. While his wife did not have a job or a car or any money, Mr. Jones said he was making $6,000 a month as an engineer at Intel and could move the kids to Mississippi where he had family and a support system.

Mr. Jones’s personal therapist, Dr. April Hames, filed an affidavit in support of his request for custody. In it, she described Mr. Jones as “a highly-intelligent, responsible father.”

“His thoughts are very detailed, action oriented, and focused on his children… When Mr. Jones sees an obstacle, he sets his sights on the solution and is willing to go through the often difficult process of achieving his goal of resolution.”

And so, Mr. Jones won primary custody of the children.

As a single father, Mr. Jones continued his connection with the county DSS. In April 2014, a teacher reported a handprint-sized bruise on one of the children, who told her teacher she had been grabbed and “pulled around the house as punishment.”

No action was taken, according to the complaint.

In May, one of the children was reported to have been choked and thrown against a wall. Mr. Jones had left bruises on the child’s neck and jaw. Another child reported that her crotch area hurt. The children were beaten with belts and one received 12 spankings. They were also forced to do push-ups and excessive exercises for misbehaving. When DSS asked Mr. Jones about the markings, he reportedly told a caseworker that his child “was very clumsy and bruised easily.”

The county DSS drafted their sixth and final safety plan.

Over the summer, a teacher who saw Mr. Jones at the store called DSS and reported bruising “all over” the children.

A babysitter called a month later, telling the agency that she walked in as Mr. Jones was “about to hurt” one of his children.

The agency’s third investigation, just weeks before the murders, found evidence that Mr. Jones had been beating one of his sons and wasn’t feeding his children. A caseworker visited the mobile home where he had moved with the kids. Her report stated Mr. Jones sometimes fed all five children with one 20-piece chicken nugget dinner and didn’t want to send his kids back to public school “because he does not want the school to report the beatings.”

On Aug. 28, 2014, the children were killed. Each one “suffer[ed] a horrific, but entirely preventable death,” the lawsuit reads.

While the courts will decide whether the Jones children might have been saved by a more effective Deparment of Social Services, the agency’s record of inadequacy when it comes to protecting the children in its care is well-documented.

Two months after the Jones children’s murders, a legislative committee charged with auditing state agencies released a report on the Department of Social Services (PDF). Among its findings: South Carolina’s DSS employees are unqualified, their caseloads are excessive and inequitable from county to county, the DSS’s overall systems are inadequate, and because of unreliable record keeping, the agency doesn’t even know how many children in the DSS system have been killed as a result of abuse or neglect.

A DSS spokesperson told a local newspaper, The State, on Tuesday that the organization had recently received increased funding for 177 new caseworkers and 67 new caseworker assistants.

Several state senators formed the Department of Social Services Oversight Subcommittee in 2013 and held 13 hearings to hear testimony from parents with experience in the system, many of whom echoed Amber Jones’s account of agency inaction when presented with evidence of abuse.

“Phones calls [to DSS], complaints, emails, contacts, subpoenas, all go unanswered,” said Nathan Ginter, a father who expressed frustration to the committee that the mother of his child was not being investigated for abuse by the agency.

The committee planned to look specifically at the Jones murders, but after a request from law enforcement not to question agency officials during an investigation, the hearing was canceled.

After reviewing the DSS file, one committee member, State Sen. Katrina Shealy, told local news station WISTV she couldn’t say whether DSS could have done anything to prevent their deaths.

“We’re sorry for the kids,” Shealy said. “We’re sorry for the family that’s left… You know, there’s just not a lot you can say about it.”