U.S. Attorney General Jeff Sessions waits to speak at the Federalist Society's 2017 National Lawyers Convention in Washington, U.S., November 17, 2017. REUTERS/Joshua Roberts

WASHINGTON (Reuters) - U.S. Attorney General Jeff Sessions on Wednesday ordered a review of a government database used for background checks on gun buyers, after a man who killed 26 people in a Texas church was left off the system despite having a criminal record.

Sessions said the Nov. 5 shooting in Sutherland Springs, Texas, by Devin Kelley, a former Air Force serviceman who had a 2012 conviction for domestic assault, showed that not all the necessary information was being added to the National Instant Criminal Background Check System, or NICS.

In a statement, Sessions said he was directing the Federal Bureau of Investigation and the Bureau of Alcohol, Tobacco, Firearms and Explosives “to do a comprehensive review of the NICS and report back to me the steps we can take to ensure that those who are prohibited from purchasing firearms are prevented from doing so.”

Kelley was found guilty by an Air Force court-martial in 2012 of assaulting his first wife and a stepson. Federal law prohibits anyone from selling a gun to someone who has been convicted of a crime involving domestic violence against a spouse or child.

The Air Force has said it failed to provide information as required about Kelley’s criminal history to the FBI’s criminal database.

Sessions said he was directing the FBI and ATF to determine if the Defense Department and other government agencies were properly reporting information to the database.

Kelley, who killed himself during a getaway attempt after the shooting, bought guns from a store in Texas in 2016 and 2017, although it is not clear whether those were the weapons used in the massacre.

The U.S. House of Representatives Armed Services Committee said earlier this month it would investigate the Air Force’s failure to notify the FBI of Kelley’s criminal record.

U.S. Senator John Cornyn of Texas, the No. 2 Republican in the chamber, said he planned to introduce legislation to ensure that federal agencies put required criminal records into the database.