The Texas church shooter shouldn't have been able to legally own a gun.
But an Air Force officer failed to enter Devin Patrick Kelley's domestic violence court-martial into a national database that would have barred him from buying weapons, the Air Force said Monday.
Top Air Force brass ordered a full review of how the service handled Kelley's conviction at a general court-martial in 2012, Ann Stefanek, a spokeswoman for the Air Force, said in a statement Monday.
"Federal law prohibited him from buying or possessing firearms after this conviction," Stefanek confirmed.
Related: Texas Church Shooter May Have Been Targeting His Mother-in-Law
Twenty-six people were killed when Kelley opened fire Sunday at First Baptist Church in Sutherland Springs, Texas, authorities said. A Glock and a Ruger handgun were discovered inside a Ford Expedition where Kelley's body was found after a chase following the shooting, authorities said, and a Ruger AR-556 rifle was recovered at the church.
Gallery: Two Dozen Parishioners Killed in Texas Church Shooting
Kelley, 26, of New Braunfels, Texas, joined the Air Force after graduating from New Braunfels High School in 2009. He trained at Lackland and Goodfellow Air Force bases in Texas, before reporting to his assignment in logistics readiness at Holloman Air Force Base, New Mexico.
In 2012, Kelley was convicted at general court-martial on two charges of assault, the Air Force said. A retired Air Force colonel who supervised prosecutors when Kelley was tried said Kelley was convicted of fracturing his baby stepson's skull and assaulting his first wife, Tessa, at Holloman.

He was confined for a year, given a bad conduct discharge and reduced in rank to E-1, or airman basic, Stefanek said.
Kelley's name should have been entered in the National Criminal Information Center, Stefanek said, but the Special Investigations Office at Holloman failed to transmit the domestic violence charges.
That would have alerted whoever sold Kelley his weapons that he was ineligible to own firearms under the 1996 Lautenberg Amendment, which bars anyone convicted of domestic violence — even misdemeanors — from getting access to guns.
The amendment is named for its sponsor, Frank Lautenberg, then a Democratic senator from New Jersey.
Air Force Secretary Heather Wilson and Gen. David Goldfein, the Air Force chief of staff, have ordered a "complete review of the Kelley case" by the service's inspector general, Stefanek said.
The Air Force will also review its databases to make sure that records in other cases have been reported correctly — and it has asked the Pentagon to review records and procedures across the Defense Department, she said.
Sen. John McCain, R-Ariz., chairman of the Armed Services Committee, said Monday night in a statement that the committee would "conduct rigorous oversight" of the Pentagon inquiry "to ensure that similar mistakes have not occurred and will not occur in the future."
Sen. Jack Reed of Rhode Island, the top Democrat on the committee, said in a statement that every military branch "needs to investigate to determine if there are systemic issues that result in failure to report information on violent crimes, particularly domestic violence cases."