AUSTIN — A federal judge in Texas has said victims of the 2017 church massacre in Sutherland Springs can continue their lawsuit against the U.S. government for its role in the shooting.

U.S. District Judge Xavier Rodriguez's Thursday ruling is a huge victory for the nine families in the case, which allows them to put federal authorities on trial for alleged negligence. Rodriguez dismissed the government's motion to throw out the case and said the families can begin the discovery process, which allows their lawyers to gather documents and seek interviews with which to make their case.

"The ruling affirms what we've known all along, and that is that these families' and victims' claims against the government are valid and just," Jamal Alsaffar, an attorney for four of the families, told The Dallas Morning News. "Judge Rodriguez's very thorough ruling allows these families to finally seek and have their day in court and seek accountability from the government."

The doctrine of sovereign immunity makes suing the federal government almost impossible. But under the Federal Tort Claims Act, people can seek damages in limited cases if they can prove direct negligence on the part of the government.

The Sutherland Springs lawsuit accuses the U.S. Air Force and the Department of Defense of negligence for failing to report the shooter's history of criminal activity and mental health problems to an FBI database. The families first had to file claims against the government, wait six months, and then decide whether to continue based on its response.

After the government's motion to dismiss, the families pushed to continue their suit, which Rodriguez gave the green light to in his ruling Thursday.

Shooter Devin P. Kelley, an Air Force veteran, had a history of violence and mental illness. He received a bad-conduct discharge in 2014 after he was convicted of beating his first wife and assaulting his stepson, and had escaped two years earlier from a mental facility where he was admitted after threatening to kill his superior officers.

Normally, these incidents would have landed Kelley on the FBI's criminal database and kept him from legally owning guns. But the Air Force admitted that it failed to report his crimes, allowing Kelley to pass two background checks before he bought a Ruger AR-556.

On Nov. 5, Kelley used this gun to shoot and kill 26 parishioners — including a pregnant woman — who were attending Sunday services at the First Baptist Church of Sutherland Springs.

In his ruling, Rodriguez said the victims have alleged that multiple federal employees failed in their reporting duties because of systemic problems at the Department of Defense.

"Plaintiffs allege that federal employees negligently collected, processed, and reported background information," he wrote. "If they can prove that this negligence was proximately caused by negligent supervision or training, the Government would be liable."

Alsaffar said the Thursday ruling allows the families' lawyers to begin issuing subpoenas to people aware of the alleged reporting failures, from data entry employees through the top ranks of the U.S. military: "There are a lot of witnesses."

The nine plaintiffs in the suit include members of the Holcombe, Johnson and Ramsey families, who lost a dozen people in the shooting. Nine members from three Holcombe generations were killed, including their unborn grandchild. Ronald Ramsey's mother, Therese Rodriguez, and her husband, Ricardo Rodriguez, were both killed. The Johnsons lost their matriarch and patriarch, Sara and Dennis Sr., who at 77 was the oldest victim of the massacre.

The families claim the government's admitted failures entitle them to damages for pain and suffering, mental anguish, mental health care expenses, past and future lost income and earning capacity and funeral costs. No dollar figure is named in the lawsuit.

Several other victims of the shooting are also suing Academy Sports + Outdoors, where Kelley purchased his firearm. He bought the Ruger and at least one high-capacity magazine there in violation of Colorado law, where he was a legal resident at the time, that suit alleges.