The Air Force failed to flag Devin Kelley as banned from buying the weapons he used to kill 26 people and wound 20 more worshipers at a South Texas church on Sunday, the Air Force acknowledged late Monday.

Kelley’s domestic violence offense was not entered into the National Criminal Information Center database by the Air Force officials at Holloman Air Force Base in New Mexico where he had served, Ann Stefanek, an Air Force spokeswoman, said in a statement to 9NEWS.

The Air Force was required to provide the information to the database because Kelley was convicted of a domestic assault and under federal law would not have been able to purchase a gun legally, which he did twice in Colorado.

A review has been ordered into how the error occurred, Stefanek said, as well as a comprehensive review of all cases to ensure they have been properly reported.

Kelley had been convicted of assault in a military court in 2012, for fracturing the skull of his young stepson, and the FBI should have barred him from buying the weapons, said Don Christensen, the service's top prosecutor whose office oversaw Kelley's Air Force prosecution.

The information related to Kelley’s court martial and the underlying domestic violence offenses were not transmitted by the military to the FBI’s National Instant Check System used to vet prospective gun purchasers, a law enforcement official said Monday.

The official, who is not authorized to comment publicly, said to USA Today that authorities had been attempting to reconcile Kelley’s gun purchases with federal law, which prohibits those with criminal records involving misdemeanor domestic violence from obtaining or owning firearms.

Under terms of a 1996 amendment to the Gun Control Act, known as Lautenberg Amendment, gun purchases would be denied to those who have used force or even attempted to use force against a family member.

The conviction should have flagged Kelley as ineligible to buy the weapons, if the FBI had been made aware of it, Christensen said.

In a Monday morning press conference, Phil Milanowski, the ATF's special agent in charge of the Houston field division, said Kelley legally bought one gun a year between 2014 and 2017. Two of them were bought in Colorado, and two of them were bought in Texas. According to 9NEWS' sister station KENS5, Kelley bought the guns in Texas in 2016 and 2017, meaning he purchased the first two in Colorado -- the first purchase being two years after the conviction.

RELATED: ATF: Texas church shooting suspect bought 2 guns in Colorado

It's not clear if Kelley truthfully said he'd been convicted of domestic abuse when purchasing a gun, and a background check failed to show that. Or, if Kelley lied about the conviction, in addition to his background check coming back clean.

"This clearly fell under federal law, without a doubt," Christensen said Monday. "The Air Force is supposed to report the information to FBI. It was possible that it was never reported. It's possible that somebody in the Air Force just blew it."

The child was born in 2010, and the beatings began a year later, Christensen said. The boy suffered subdural hematoma, bleeding in his brain, from shaking, and skull fractures, Christensen said. Kelley offered a partial confession to the charges and entered a plea agreement that capped his sentence at three years.

Kelley was also convicted at court martial of beating his wife and was jailed for one year; Air Force documents say Kelley beat and choked his wife and pulled her hair. He also received a bad conduct discharge, not the harsher dishonorable discharge, and was busted to the Air Force's lowest rank.

The oversight could have occurred because the military court labeled Kelley's assaults on his wife and stepson in the same category as a bar fight, said Christensen, who is now president of Protect Our Defenders, an advocacy group for victims of sexual assault in the services.

"It's also possible, where we often see, when they do report, the information is not translated court-martial speak to the civilian world," Christensen said.

The military also has been reluctant to hold troops accountable for domestic abuse, Christensen said.

A 2014 police report from the El Paso County Sheriff's Office also details animal abuse allegations against Kelley, who lived in Colorado Springs at the time. That case was eventually dismissed.

RELATED: Man who killed 26 inside Texas church arrested for animal cruelty in Colorado

Kelley used a Ruger AR-15 in the church shooting, purchased last year in San Antonio, and two handguns were found in his vehicle, authorities said.