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 Kelley was also named as a suspect in a 2013 sexual assault in his Texas hometown of New Braunfels, about 35 miles from the church attack.

Kelley was 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, N.M., 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 Sutherland Springs, investigators continued analyzing the crime scene and tried to gain access to the shooter’s cellphone, a long-standing challenge for the FBI in thousands of other cases.

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, 26, and his mother-in-law, who sometimes attended services at the church but was not present Sunday.

Kelley had previously attended the church, but the pastor “did not think that he was a good person and did not want him around his church,” Wilson County Sheriff Joe Tackitt told CNN on Tuesday. “But he said, ‘How do I run him away from my church?’?”

A couple who survived the attack described how the gunman went aisle to aisle looking for victims and shot crying babies at point-blank range.

Rosanne Solis and Joaquin Ramirez were sitting near the entrance to the church when they heard what sounded like firecrackers and realized someone was shooting at the wood-frame building.

In an interview with San Antonio television station KSAT, Solis said congregants began screaming and dropped to the floor. She could see fellow worshippers falling down, bloodied, after getting hit.

For a moment, the attack seemed to stop, and worshippers thought that police had arrived. But then Kelley entered the church and resumed “shooting hard,” Solis said.

The couple survived by playing dead. Solis was shot in the arm. Ramirez was hit by shrapnel.

Kelley had a history of domestic violence that spanned years before the attack and was able to 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 said Monday.

Investigators also revealed that Kelley had sent threatening text messages to his mother-in-law 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.

Sen. John Cornyn, R-Texas, said Tuesday that Congress would begin working on legislation to tighten background-check compliances for gun purchases.

“Obviously if things like this can happen in spite of the law, then we need to look at that and try to fix it as best we can,” Cornyn, the GOP whip, said. “This seems to be an area where there is bipartisan support.”

At a news conference in South Korea, President Donald 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.

Washington Bureau’s Lisa Mascaro contributed.