AUSTIN -- A mistake by U.S. Air Force officials in reporting Devin Patrick Kelley's past conviction for domestic violence allowed him to buy four guns, including the semi-automatic rifle used in the Sunday shooting at a South Texas church that left 26 dead and 20 others wounded, state and federal officials confirmed Monday.

Pentagon officials that had Kelley's 2012 conviction in a military court for assaulting his then-wife and stepson been reported correctly to a national database used in clearing people to buy guns, the 26-year-old New Braunfels man would have been denied permission to buy the weapons.

Retired Col. Don Christensen, who was the chief prosecutor for the Air Force at the time of Kelley's general court-martial, said that while Kelley's punitive discharge -- a bad conduct discharge -- would not have prohibited him from owning a gun, his sentence to a year's confinement in a military prison would have.

Under federal law, anyone convicted of "a crime punishable by imprisonment for a term exceeding one year" is prohibited from possessing a firearm, federal officials said.

"He fractured his baby stepson's skull," Christensen said of the crime of which Kelley was convicted.

Air Force officials are investigating the mistake, Pentagon officials confirmed to The Associated Press.

Texas Department of Public Safety and other state officials said earlier Monday that Kelley was denied a state handgun license, even though he would not have needed one to possess the Ruger AR-556 semi-automatic assault rifle reportedly used in the shooting.

That was among four guns he purchased -- two in Colorado, two in Texas -- between 2014 and 2017, officials confirmed. The two in Texas were purchased at Academy Sports and Outdoors stores in San Antonio after cleared the required pre-purchase background check, officials and the company confirmed.

Your browser does not support the iframe HTML tag. Try viewing this in a modern browser like Chrome, Safari, Firefox or Internet Explorer 9 or later.

State investigators said they have been told that Kelley purchased the rifle in April 2016 from an Academy Sports & Outdoors store in San Antonio. When he filled out the paperwork for the mandatory background check, Kelly checked a box stating he did not have a criminal history that would disqualify him from purchasing the weapon, another law enforcement source said.

At the time, he listed a Colorado Springs, Colo, home address.

In a statement Monday, Academy said federal officials verified that Kelley bought two guns from two of their San Antonio stores, one in 2016 and one in 2017, and "both sales were approved by the National Instant Criminal Background Check System" -- the system that federal officials use to approve purchasers.

"So how was it that he was able to get a gun? By all the facts that we seem to know, he was not supposed to have access to a gun," Gov. Greg Abbott told CNN. "So how did this happen?"

Abbott and DPS officials insisted that state licensing rules had worked as they should have, in that Kelley was denied a concealed handgun permit. They said current state law prohibited him from getting a licensed firearm, because of his record of military imprisonment and his past conviction of domestic violence for assaulting his wife and child.

Federal officials who are responsible for federal gun-purchase background checks said they are investigating how Kelley was able to purchase the guns. Several investigators familiar with those checks said the details of his military discharge should likely have precluded him from being approved.

Even if his record of domestic assault charges did not technically block him from possessing guns under federal law, a charge of assault and his year of imprisonment should have, they said.

According to eyewitnesses, a man dressed in black tactical gear and a bullet-proof vest parked at a gas station across the street from the First Baptist Church in Sutherland Springs around 11:20 a.m., walked across the street carrying the rifle and opened fire outside the church.

DPS Regional Director Freeman Martin said Kelley then entered the church and continued shooting.

As the shooter fled from the church, state officials said, a man grabbed his weapon and the suspect dropped it. The shooter then fled in his vehicle, with two armed residents in other vehicles.

Wilson County Sheriff Joe Tackitt said that during the pursuit, Kelley crashed his vehicle and killed himself.

"There was some gunfire exchanged, I believe, on the roadway also, and then (the shooter's vehicle) wrecked out," Tackitt said.

Investigators said Monday that three guns were found inside Kelley's SUV

As more details of the tragedy became public on Monday, questions surfaced about how he could have been in the possession of a semi-automatic rifle and three pistols, and have been licensed as private security guard in Texas, with his checkered past.

Outside the investigation, gun law opponents used the shooting Monday to showcase why new restrictions are needed to limit the sale of semi-automatic rifles and other military-style assault weapons.

"This is yet another tragedy that begs an important question of policymakers, not only in Texas but in other states and at the national level, as well," former state Sen. Wendy Davis said Monday at a State Capitol rally on a youth voter-turnout initiative.

"Are we going to assure that the people who have rights to gun ownership in this country have the demonstrated capacity to handle that responsibly? Are we going to get serious about closing the gun show loophole that we know not only provides an opportunity for persons like this particular shooter to access weaponry? . . . Are we going to be responsible about having a a conversation regarding assault weaponry and rapid-fire weapons that provide an opportunity for such tremendous human carnage?"

Texas Attorney General Ken Paxton, a staunch gun rights advocate, had a different view of the tragedy.

"I wish some law would fix all of this," he told FoxNews, but adding that "if someone is willing to kill someone, they're also going to be willing to violate a gun law."

"All I can say is in Texas at least we have the opportunity to concealed carry," Paxton said, summing up the position of various Second Amendment supporters in Texas who quickly lit up social media defending Texas' gun laws after the tragedy. "And so ... there's always the opportunity that gunman will be taken out before he has the opportunity to kill very many people.

"As we speak, we've had shootings at churches for forever. This is going to happen again. And so, we need people in terms of professional security or in terms of arming the parishioners or the congregation so that they can respond when something like this happens again," he said.