The gunman who slaughtered 26 people at a Texas church was able to buy weapons because the US Air Force failed to report his domestic violence conviction to the federal database that is used to conduct background checks on would-be gun purchasers, authorities said.
Federal officials said the Air Force did not submit Devin Patrick Kelley's criminal history even though it was required to do so by Pentagon rules.
Kelley, 26, was found guilty of assault in an Air Force court-martial in 2012 for abusing his wife and her child and was given 12 months' confinement followed by a bad-conduct discharge in 2014.
That same year, authorities said, he bought the first of four weapons.
Under Pentagon rules, information about convictions of military personnel for crimes like assault should be submitted to the FBI's Criminal Justice Investigation Services Division.
It is the kind of lapse that gun-control advocates say points to loopholes and failures with the background check system.
At issue is the Lautenberg Amendment, enacted by Congress in 1996.
The US federal law was designed to prohibit people convicted of domestic violence from buying or possessing a firearm regardless of whether the crime was a felony or a misdemeanour.
"This is exactly the guy the Lautenberg Amendment is supposed to prevent from possessing a firearm," said Rachel VanLandingham, a professor at Southwestern Law School in Los Angeles and a retired Air Force lieutenant colonel and former judge advocate.
"Of course, the law only works if folks are abiding by the law."
Air Force spokeswoman Ann Stefanek said in an email that the service is launching a review of its handling of Kelley's case and taking a comprehensive look at Air Force databases to make sure other cases have been reported correctly.
An initial review indicates that Kelley's conviction was not entered into the federal database by officials at Holloman Air Force Base's office of special investigations, the Air Force said.
Kelley served at Holloman in New Mexico from 2010 until his discharge.
He was in logistics, responsible for moving passengers and cargo.
Authorities said Kelley owned four guns, including the three he had with him during the attack: a Ruger AR-15 that was used in the church and two handguns that were in his car.
The weapons were purchased, one each year, from 2014 to this year.
A 2015 report by the Pentagon's inspector general found lapses in the military's reporting to civilian authorities of domestic violence convictions.
From November 30 1998, until last week, firearms purchases in the US were denied 136,502 times because of a domestic violence conviction, according to Justice Department statistics.
"The fact this guy was even court martialled at all indicates it reached a certain level of severity that should act as a red flag that this is a dangerous person and shouldn't have a gun," said Lindsay Nichols, the US federal policy director at the Giffords Law Centre to Prevent Gun Violence.
The centre is named after former Congresswoman Gabby Giffords, who was gravely wounded by a gunman in 2011.