Attorney General Jeff Sessions on Wednesday ordered a far-ranging review of the FBI database used to check the backgrounds of prospective gun buyers, after the Air Force failed to report the criminal history of the gunman who slaughtered more than two dozen people at a Texas church.

The failure enabled him to buy weapons, purchases his domestic violence conviction should have barred.

Sessions directed the FBI and the Bureau of Alcohol, Tobacco, Firearms and Explosives to determine if other government agencies are failing to report information to the National Instant Criminal Background Check System. He also wants a report detailing the number of times the agencies investigate and prosecute people for lying on their gun-purchase applications and a closer look at the format of the application itself.

The database "is critically important to protecting the American public from firearms-related violence," Sessions wrote in his memo. "It is, however, only as reliable and robust as the information that federal, state, local and tribal government entities make available to it."

The Pentagon's inspector general launched a separate review of the Texas gunman, Devin P. Kelley, after the Air Force revealed it had failed to submit his domestic abuse case to the database. Kelley was able to buy four guns despite the conviction. He used a Ruger AR rifle with a 30-round magazine during the Nov. 6 shooting, going from aisle to aisle as he shot parishioners.

Sessions said the revelation was "alarming." But the Pentagon has long known about failures to give military criminal history information to the FBI.

Sessions ordered the FBI and ATF to work with the Defense Department on its review and to identify other obstacles agencies face in sharing information with the database.

The problem has also caught the attention Republican and Democratic lawmakers, who joined forces on legislation that aims to strengthen the database by ensuring federal agencies and states accurately report relevant criminal information to the FBI.