Editor's note: This story is being continually updated with breaking developments.

The shooter who killed 26 people at a church in Sutherland Springs on Sunday shouldn't have been able to purchase a gun under federal law, according to a preliminary statement by the U.S. Air Force obtained by The Texas Tribune.

But 26-year-old Devin Kelley was able to buy three firearms because his domestic violence record wasn’t entered into the National Criminal Information Center database.

According to the Air Force news release, Kelley, who lived in Comal County, was convicted by a general court-martial on two charges of domestic assault against his wife and stepson. He then served 12 months in confinement before being released with a bad conduct discharge in 2014.

"Federal law prohibited him from buying or possessing firearms after this conviction," the Air Force statement said. The statement didn’t elaborate on why the conviction wasn’t entered into the national database, which is used for criminal background checks when people try to buy firearms.

The Air Force statement said Secretary Heather Wilson and Chief of Staff Gen. David Goldfein have "directed a complete review of the Kelley case by the Air Force Office of the Inspector General. The Service will also conduct a comprehensive review of Air Force databases to ensure records in other cases have been reported correctly. The Air Force has also requested that the Department of Defense Inspector General review records and procedures across the Department of Defense."

The shooter also tried to get a license to carry a gun in Texas but was denied by the state, Texas Gov. Greg Abbott told CNN's Chris Cuomo this morning. His denial was likely because of his domestic violence charge, experts told the Tribune.

The Air Force released Kelley's general court-martial documents, dated January 2013, that show he was found guilty of striking his wife, choking her, pulling her hair and kicking her between June 2011 and April 2012. The document said Kelley also struck his stepson “on the head and body with a force likely to produce death or grievous bodily harm.”

“So how was it that he was able to get a gun? By all the facts that we seem to know, he was not supposed to have access to a gun,” Abbott said, citing the Texas Department of Public Safety. “So how did this happen?”

Fred Milanowski, a special agent with the Bureau of Alcohol, Tobacco, Firearms and Explosives, confirmed that three firearms were recovered — including two handguns. "All three firearms were purchased by the deceased suspect," Milanowski said.

As far as the agency knows, there's nothing that precluded Kelley from purchasing a gun, he said.

Hannah Shearer, staff attorney and second amendment litigation director at the Giffords Law Center to Prevent Gun Violence, said Texas prohibits people convicted of domestic violence misdemeanors from obtaining a license to carry a handgun. The nonprofit, led by former Congresswoman Gabrielle Giffords and her husband, Mark Kelly, was founded after Giffords was shot in the head in 2011 outside a grocery store in Arizona.

“So it seems likely that for at least one of those reasons — according to Texas’s records — he didn’t meet the standards and so they denied his permit,” Shearer said.

At a press conference on Sunday, law enforcement officials said it was too early to speculate on a motive for the killings. However, Freeman Martin, the DPS regional director for San Antonio, said Monday that the shooting may have been the result of a "domestic dispute."

According to Martin, Kelley had a mother-in-law who attended First Baptist Church. Freeman said the mother-in-law had received threatening texts from Kelley and DPS was investigating the situation.

Martin confirmed that Kelley didn't own a license to carry but had a private security license.

In a press briefing Monday morning, a DPS official said the agency had retrieved video footage from inside First Baptist Church and that all bodies had been removed.

On Sunday, Kelley entered First Baptist Church of Sutherland Springs and opened fire. The victims range from 18 months to 77 years old and included the pastor's 14-year-old daughter.

"Our church was ... a very close family, now most of our church family is gone," Sherri Pomeroy, the wife of First Baptist Church's pastor, Frank Pomeroy, said Monday.

Officials say when the shooter was confronted by a local resident with a gun, he fled the scene. He was later found dead in his car; the cause of death has not been publicly released.

According to Martin, 23 people died inside the church, two were killed outside and another died in transport to a local hospital. Authorities said about 20 others were taken to hospitals with injuries ranging from minor to “very severe.” Martin said four shooting victims are in serious condition and another 10 are in critical condition.

"We're not sure if that number will rise or not," Abbott said Sunday night at a news conference. "This will be a long, suffering mourning for those in pain. These people were innocently gunned down."

Vice President Mike Pence announced Monday afternoon he will visit Sutherland Springs on Wednesday. In a tweet, Pence said he and Second Lady Karen Pence will make the trip to "meet w/families of the fallen, injured & law enforcement."

Abbott called the shooter "deranged," and President Donald Trump said Kelley had "a lot of problems over a long period of time."

"We have a lot of mental health problems in our country — as do other countries — but this isn't a guns situation," Trump said while speaking at an event in Japan. "I mean, we could go into it but it’s a little bit soon to go into it. But, fortunately somebody else had a gun that was shooting in the opposite direction."

Check back here for updates throughout the day.

Jolie McCullough contributed reporting from Sutherland Springs.