Carrie Matula embraces a woman after a fatal shooting at the First Baptist Church in Sutherland Springs, Texas, on Sunday, Nov. 5, 2017. Matula said she heard the shooting from the gas station where she works a block away.

Nick Wagner, Austin American-Statesman via AP

Law enforcement officials work the scene of a fatal shooting at the First Baptist Church in Sutherland Springs, Texas, on Sunday, Nov. 5, 2017.

Jay Janner, Austin American-Statesman via AP

Investigators work at the scene of a mass shooting at the First Baptist Church in Sutherland Springs, Texas, on Sunday Nov. 5, 2017. A man opened fire inside of the church in the small South Texas community on Sunday, killing more than 20 people.

Jay Janner, Austin American-Statesman via AP

Investigators work at the scene of a deadly shooting at the First Baptist Church in Sutherland Springs, Texas, Sunday Nov. 5, 2017. A man opened fire inside of the church in the small South Texas community on Sunday, killing more than 20 people.

Nick Wagner, Austin American-Statesman via AP

A man wipes his eyes after a deadly shooting at the First Baptist Church in Sutherland Springs, Texas, Sunday, Nov. 5, 2017. A man opened fire inside of the church in the small South Texas community on Sunday, killing more than 20 people.

San Antonio Express-News, Zuma Press/TNS

A group gathered in prayer outside the Community Center, after a mass shooting occurred at the First Baptist Church on Sunday, Nov. 5, 2017.

Jay Janner, Austin American-Statesman via AP

Enrique and Gabby Garcia watch investigators at the scene of a mass shooting at the First Baptist Church in Sutherland Springs, Texas, on Sunday Nov. 5, 2017. A man opened fire inside of the church in the small South Texas community on Sunday, killing more than 20 people.

Erich Schlegel, Getty Images

Law enforcement and forensic officials gather near the First Baptist Church following a shooting on Nov. 5, 2017 in Sutherland Springs, Texas. At least 20 people were reportedly killed and 24 injured when a gunman, identified as Devin P. Kelley, 26, entered the church during a service and opened fire.

Erich Schlegel, Getty Images

People gather near First Baptist Church following a shooting on Nov. 5, 2017 in Sutherland Springs, Texas. At least 26 people were reportedly killed and 24 injured when a gunman, identified as Devin P. Kelley, 26, entered the church during a service and opened fire.

Jay Janner, Austin American-Statesman via AP

A couple comfort each other at a community center in Sutherland Springs, Texas, near the scene of a mass shooting at the First Baptist Church on Sunday, Nov. 5, 2017. A man opened fire inside of the church in the small South Texas community on Sunday, killing more than 20 people.

Nick Wagner, Austin American-Statesman via AP

A woman prays with a man after a fatal shooting at the First Baptist Church in Sutherland Springs, Texas, on Sunday, Nov. 5, 2017.

Eric Baradat, AFP/Getty Images

Texas Governor Greg Abbott speaks at a press conference on Nov. 5, 2017, in Sutherland Springs, Texas about the First Baptist Church mass shooting.
"There are 26 lives that have been lost. We don't know if that number will rise or not, all we know is that's too many, and this will be a long, suffering mourning for those in pain," Abbott said.

Suzanne Cordeiro, AFP/Getty Images

Wilson County Sheriff Joe Tackitt (C) speaks at a press conference on Nov. 5, 2017, in Sutherland Springs, Texas about the First Baptist Church mass shooting.
"There are 26 lives that have been lost. We don't know if that number will rise or not, all we know is that's too many, and this will be a long, suffering mourning for those in pain," Texas Governor Greg Abbott (L seated) said.

Darren Abate, The Associated Press

Law enforcement officers man a barricade near the First Baptist Church of Sutherland Springs after a fatal shooting, Sunday, Nov. 5, 2017, in Sutherland Springs, Texas.

Suzanne Cordeiro, AFP/Getty Images

Police block a road in Sutherland Springs, Texas, on Nov. 5, 2017, after a mass shooting at the the First Baptist Church.
A gunman went into the church during Sunday morning services and shot dead some two dozen worshippers, the sheriff said, in the latest mass shooting to shock the US. "Approximately 25 people" were dead, including the shooter, Wilson County Sheriff Joe Tackitt told NBC News. At least 10 people were wounded. The motive was not immediately known, he added.

Nick Wagner, Austin American-Statesman via AP

Law enforcement officials works at the scene of a fatal shooting at the First Baptist Church in Sutherland Springs, Texas, on Sunday, Nov. 5, 2017.

Darren Abate, The Associated Press

Members of the FBI walk behind the First Baptist Church of Sutherland Springs after a fatal shooting, Sunday, Nov. 5, 2017, in Sutherland Springs, Texas.

Jay Janner, Austin American-Statesman via AP

Texas Gov. Greg Abbott consoles Ann Montgomery, a Sunday school teacher at First Baptist Church in Sutherland Springs during a candlelight vigil for the victims of a fatal shooting at the First Baptist Church of Sutherland Springs, Sunday, Nov. 5, 2017, in Sutherland Springs, Texas.

Darren Abate, The Associated Press

Mourners participate in a candlelight vigil held for the victims of a fatal shooting at the First Baptist Church of Sutherland Springs, Sunday, Nov. 5, 2017, in Sutherland Springs, Texas.

Darren Abate, The Associated Press

Mourners participate in a candlelight vigil held for the victims of a fatal shooting at the First Baptist Church of Sutherland Springs, Sunday, Nov. 5, 2017, in Sutherland Springs, Texas.

Jay Janner, Austin American-Statesman via AP

Bailey LeJeaune, 17, and David Betancourt, 18, hold candles during a vigil in Sutherland Springs for the victims of a deadly shooting at the First Baptist Church in Sutherland Springs, Texas, Sunday, Nov. 5, 2017. A man opened fire inside of the church in the small South Texas community on Sunday, killing more than 20 people.

Nick Wagner, Austin American-Statesman via AP

Lisa Cavazos speaks with Texas Gov. Greg Abbott during a candlelight vigil held for the victims of a fatal shooting at the First Baptist Church of Sutherland Springs, Sunday, Nov. 5, 2017, in Sutherland Springs, Texas.

SUTHERLAND SPRINGS, Texas — The gunman who killed 26 people at a small-town Texas church was treated at a mental health center in New Mexico and briefly escaped in 2012, according to a police report.

Devin Patrick Kelley was also caught trying to bring guns onto Holloman Air Force Base in New Mexico when he was stationed there, according to an El Paso police report obtained by several media outlets.

Kelley, who was 21 at the time, had made death threats against superior officers, the report said.

He was committed to a mental health facility in Santa Teresa, New Mexico, but at some point escaped and was later found by police at a bus station in downtown El Paso in June 2012.

Meanwhile at the First Baptist Church in tiny Sutherland Springs, investigators continued analyzing a gruesome crime scene and tried to gain access to the shooter’s cellphone, a longstanding challenge for the FBI in thousands of other cases.

Authorities aimed to conclude the crime-scene investigation at the church by Wednesday evening. Investigators have no reason to believe anyone conspired with Kelley, who acted alone, said Texas Department of Public Safety Regional Director Freeman Martin.

Martin repeated earlier statements that the shooting appeared to stem from a domestic dispute involving Kelley and his mother-in-law, who sometimes attended services at the church but was not present on Sunday.

“We don’t know what he was thinking or what was in his mind,” Martin said. “There was conflict. He was upset with the mother in law.”

The gunman’s phone was flown to an FBI lab for analysis, but agents have yet to access it, said Christopher Combs, who is in charge of the agency’s San Antonio division.

The inability to access the shooter’s phone highlights a longstanding frustration of the FBI, which said it has been unable to retrieve data from half the mobile devices it tried to access in less than a year.

Director Christopher Wray said last month that in the first 11 months of the fiscal year, agents were unable to access the content inside more than 6,900 mobile devices, an issue he said stymies investigations.

The FBI and other law enforcement officials have long complained about being unable to unlock and recover evidence from cellphones and other devices seized from suspects even if they have a warrant. Technology companies have refused to help, insisting they must protect customers’ digital privacy.

The long-simmering debate was on display in 2016, when the Justice Department tried to force Apple to unlock an encrypted cellphone used by a gunman in a terrorist attack in San Bernardino, California. The department eventually relented after the FBI said it paid an unidentified vendor who provided a tool to unlock the phone and no longer needed Apple’s assistance, avoiding a court showdown.

The Justice Department under President Donald Trump has suggested it will be aggressive in seeking access to encrypted information from technology companies. But in a recent speech, Deputy Attorney General Rod Rosenstein stopped short of saying exactly what action it might take.

Kelley had a history of domestic violence that spanned years before the attack and was able buy weapons because the Air Force did not submit his criminal history from his time in the military to the FBI, as required by military rules.

If Kelley’s past offenses had been properly shared, they would have prevented him from buying a gun, the Air Force acknowledged Monday.

Investigators also revealed that Kelley had sent threatening text messages to his mother-in-law, a member of the church, before the attack, and that sheriff’s deputies had responded to a domestic violence call in 2014 at his home involving a girlfriend who became his second wife.

Later that year, he was formally ousted from the Air Force for a 2012 assault on his ex-wife in which he choked her and struck her son hard enough to fracture his skull.

At a news conference in South Korea, Trump was asked if he would support “extreme vetting” for gun purchases in the same way he has called for “extreme vetting” for people entering the country. Trump responded by saying stricter gun control measures might have led to more deaths in the shooting because a bystander who shot at the gunman would not have been armed.

“If he didn’t have a gun, instead of having 26 dead, you would have had hundreds more dead,” Trump said.

Investigators collected at least 15 empty magazines that held 30 rounds each at the scene, suggesting the assailant fired at least 450 rounds. About 20 people were wounded.

Based on evidence at the scene, investigators believe Kelley died of a self-inflicted gunshot wound after he was chased by bystanders, one of whom was armed, and crashed his car.

While in the military, Kelley served in logistics readiness at Holloman Air Force Base in New Mexico from 2010 until his 2014 discharge, Air Force spokeswoman Ann Stefanek said.

He was discharged for the assault involving his previous wife and her child and had served a year of confinement after a court-martial. Under Pentagon rules, information about convictions of military personnel for crimes such as assault should be submitted to the FBI’s Criminal Justice Investigation Services Division.

Stefanek said the service is launching a review of its handling of the case and taking a comprehensive look at its databases to ensure other cases have been reported correctly.

A few months before he received the bad-conduct discharge, sheriff’s deputies went to his home to check out the domestic violence complaint involving him and his then-girlfriend. People in the house said there was no problem, and no arrests were made. Kelley married the girlfriend two months later.

Kelley lived in New Braunfels, about 35 miles (55 kilometers) north of the church, and had recently started a job as an unarmed security guard at a nearby resort.

___

Weber reported from New Braunfels. Associated Press writers Sadie Gurman in Washington, John Mone in Sutherland Springs, Nomaan Merchant in Houston and Diana Heidgerd in Dallas also contributed to this report.

___

Sign up for the AP’s weekly newsletter showcasing our best reporting from the Midwest and Texas: http://apne.ws/2u1RMfv .

More in Nation World News

Police who find suspected drugs during a traffic stop or an arrest usually pause to perform a simple task: They place some of the material in a vial filled with liquid. If the liquid turns a certain color, it’s supposed to confirm the presence of cocaine, heroin or other narcotics.

Doctors in Syria’s rebel-controlled suburbs of Damascus said Wednesday they were unable to keep up with the staggering number of casualties, amid a ferocious bombing campaign by government forces that has targeted hospitals, apartment blocks and other civilian sites, killing and wounding hundreds of people in recent days.

The Supreme Court ruled unanimously Wednesday that whistleblower protections passed by Congress in the wake of the financial crisis of 2008 apply only when those alleging corporate misdeeds bring their information to the government.

A prominent white nationalist is suing Twitter for banning his accounts at a time when social networks are trying to crack down on hateful and abusive content without appearing to censor unpopular opinions.