The 26 people murdered and 22 wounded in a Texas church in November 2017 by a disgraced airman might still be alive and well if the U.S. Air Force had done as required and alerted the FBI to his danger, according to a shocking new Pentagon inspector general’s report.

There have been more than 300 mass shootings in the United States in the year since Devin Patrick Kelley shot up the First Baptist Church on a Sunday morning in Sutherland Springs, about 30 miles outside San Antonio. But his massacre, for which he was kitted out in what a witness described as “full gear,” was the bloodiest act at a U.S. house of worship to date.

Kelley, who served in the Air Force from 2010 to 2012, exhibited clear warning signs that he posed a threat to others. Like many mass murderers, he had an extensive history of misogynistic violence.

Yet on four different occasions, the Air Force did not follow Defense Department policy to pass Kelley’s fingerprints to the FBI’s Criminal Justice Information Services once Air Force investigators determined probable cause for assault, the IG report states. The point of the policy is to prevent violent people from legally purchasing firearms. Kelley went on his killing spree, CNN reported, after legally purchasing a Ruger AR-556 rifle from an outdoor sporting-goods store in San Antonio. Among his victims were eight members of a single family, and the 14-year-old daughter of First Baptist’s pastor.

The Pentagon inspector general does not state that the Air Force has the blood of the First Baptist Church on its hands. But the report points out the military has a systemic problem, stretching back more than 20 years despite multiple internal reports, with alerting law enforcement to violent threats posed by servicemembers.

Since 1997, the watchdog has repeatedly warned the military of “significant deficiencies in the Military Services’ compliance with the requirement to submit criminal history data to the FBI,” reads the report, which was issued Thursday.

“My work is so lucky I do not have a shotgun,” Kelley’s wife once quoted him to investigators, according to the report. “Because I would go in there and shoot everyone.”

In June 2011, Kelley’s stepson, not even a year old, was hospitalized and eventually placed into foster care after showing bruises believed to have come from the then-airman. Within days, his wife, Tessa, reported that her husband “physically assaulted her by grabbing her around the throat, choking her, and throwing her against a wall,” the IG report says.

Months later, Kelley expressed his dissatisfaction over Tessa wanting to go for an evening walk by choking her, dragging her by her hair into their bathroom, forcing her head under the showerhead and declaring, “I’m going to waterboard you.” She told Air Force investigators that Kelley threatened to “bury her in the desert somewhere” if she “said anything to anybody.” The following year, on two separate occasions, Kelley threatened Tessa with a gun, saying he would kill them both.

One of the guns Kelley threatened Tessa with was a .38 revolver that he purchased at the exchange on Holloman Air Force Base, where he was assigned. He bought it five days before the 49th Security Forces Squadron learned about Tessa’s domestic-violence allegations. Seven different times, from March 14 to April 26, 2012, Kelley availed himself of on-base mental-health services, the watchdog reported.

The Air Force’s Office of Special Investigations (OSI) eventually had criminal inquiries into Kelley for assaulting Tessa and her baby. That marked two times, the inspector general found, that the service ought to have provided his fingerprints to the FBI.

While Kelley was under criminal investigation for, among other things, threatening to murder Tessa, he walked back into the Holloman exchange on April 12, 2012, and easily, legally purchased a Sig Sauer 9-millimeter handgun. Thanks to the Air Force’s earlier inaction, there was no reason Kelley ought to have failed his background check.

Those would not be the last times the Air Force failed to do as it was required.

Kelley, at the behest of his wife, recorded a video confession in June 2012 admitting to beating his 11-month stepson out of “frustration.” Tessa provided it to Kelley’s first sergeant, who passed it on to OSI. The confession, the Pentagon inspector general found, marked the third time the Air Force shirked its responsibility to give the FBI the airman’s fingerprints.

Finally, in November 2012, Kelley pleaded guilty in an Air Force court-martial proceeding. He was sentenced to a year’s confinement, a rank reduction to Airman Basic, and a bad-conduct discharge. Not even then did the Air Force provide the FBI with critical information on a man who would soon be free to launch his rampage.

These would not be the only incidents of violence ahead of Kelley’s church shooting. According to the documents, he repeatedly groped and forcibly masturbated in front of an acquaintance’s girlfriend in 2012. In June 2013, the inspector general found that Kelley raped a 20-year-old woman on two occasions. The woman was what the report calls a “close friend” of Tessa Kelley. She reported Kelley’s sexual assault to the Comal County sheriff, but investigators closed the case without charge owing to what they described as an inability to subsequently contact the survivor.

Three years later, Kelley sent a Facebook message to his old supervisor in the 49th Logistics Readiness Squadron. “Hey you stupid bitch. You should have been put in the ground a long time ago,” it began. She decided against calling the police and getting a restraining order “because she felt that he would find out where she lived,” the inspector general found. Kelley would later write her that he regretted “not ending her.”

Shortly before murdering two dozen worshippers at First Baptist on Nov. 5, 2017, Kelley posted a picture of his rifle on Instagram, with a caption reading, “She’s a bad bitch.” He shot and killed himself after committing a massacre that the Air Force might have prevented.