The Air Force failed six times to report information that could have prevented the ex-airman who killed more than two dozen people in a Texas church from purchasing a gun, according to a government report released Friday.

The Department of Defense inspector general's report details Devin Patrick Kelley's decade-long history of violence, interest in guns and menacing of women. That history culminated in Kelley's November 2017 attack on the First Baptist Church in Sutherland Springs, the church his wife and mother-in-law attended. The dead included several children, a pregnant woman and a 77-year-old grandfather.

Kelley served almost five years in the Air Force, during which he was court-martialed and sentenced to one year's confinement for assaulting his wife and stepson. He was able to purchase four firearms after being discharged in 2014, three of which he carried into the church.

The Air Force was blamed immediately after the shooting for not reporting the assault to the FBI. The conviction would have been a red flag in the mandatory background check when Kelley tried to purchase a gun.

Friday's report says Air Force investigators who spoke to Kelley failed four separate times to fingerprint him and turn those prints over to the FBI. The report also says the Air Force failed twice to submit its final report of the case to the FBI.

Air Force investigators were not trained to submit fingerprints or the final report to the FBI, the inspector general found. The Air Force squadron that investigated the assault "used on-the-job training as its primary method of instruction for fingerprint collection and submission," the report says. "However, this training was insufficient and was not based on any established curriculum or policy requirements."

The Air Force said in a statement Friday that "corrective action has already been taken." It has reviewed all case files since 1998, and "all criminal history reporting requirements that would preclude someone from purchasing a firearm have been updated."

Gunmen in many American mass shootings have repeatedly been able to exploit loopholes or lapses in background checks.

Friday's report also details some of the many warning signs against Kelley.

His first wife, Tessa Kelley, accused him of choking her multiple times and once holding her head under a showerhead and saying, "I'm going to waterboard you." Waterboarding is an interrogation technique that the United Nations says is considered torture.

After Air Force authorities opened an assault investigation against him, Kelley was ordered to be detained before trial because his commander believed he was "dangerous and likely to harm someone if released." Kelley had searched online for body armor and weapons, according to the report.

Kelley was later charged with misdemeanor animal cruelty after someone saw him punch a dog several times. He was also investigated for sexual assault in his hometown of New Braunfels, Texas, but authorities didn't pursue the investigation in what the local sheriff has since called "an error."

The report also says Kelley was reprimanded in 2012 for using a "disparaging word" against a female supervisor and then denying it. Four years later, his former supervisor received a Facebook message from Kelley in which he used expletives and said: "You should have been put in the ground a long time ago. Better hope I don't ever see you."