The United States Air Force on Monday admitted that it failed to enter the domestic violence record of the gunman, who killed 26 worshippers in a church in Texas, into a government database that licensed gun sellers use to run background checks on firearms purchasers, Reuters reported.

Under federal law, Devin P Kelley’s conviction for assaulting his wife and stepson, a toddler, should have prevented him from buying the military-style rifle and three other guns that he possessed, The New York Times reported. A sporting goods shop said Kelley passed background checks when he bought two guns there, Reuters reported.

Air Force Secretary Heather Wilson and Air Force Chief of Staff General David Goldfein said that the Air Force Inspector General had been ordered to “conduct a complete review of the Kelley case,” a statement said.

On Monday, officials said that the gunman was embroiled in a dispute with his in-laws and was sending threatening messages to his mother-in-law.