In 2012, while stationed at Holloman Air Force Base in New Mexico, Mr. Kelley was charged with assault, according to Air Force records, which said he had repeatedly struck, kicked and choked his first wife beginning just months into their marriage, and hit his stepson’s head with what the Air Force described as “a force likely to produce death or grievous bodily harm.”
“He assaulted his stepson severely enough that he fractured his skull,” said Don Christensen, a retired colonel who was the chief prosecutor for the Air Force, adding, “He pled to intentionally doing it.”
Prosecutors withdrew several other charges as part of their plea agreement with Mr. Kelley, including allegations that he repeatedly pointed a loaded gun at his wife.
He was ultimately sentenced in November that year to 12 months’ confinement and reduction to the lowest possible rank. His final duty title was “prisoner.”
His first wife, Tessa Kelley, divorced him while he was confined and was awarded the couple’s only four household items of value: a television, an Xbox, a wedding ring and a revolver.
After his confinement, Mr. Kelley was forced out of the military with a bad conduct discharge. The Air Force said the conviction should have barred Mr. Kelley from owning any guns. Instead, law enforcement officials say, he bought several.
Friends from New Braunfels, Tex., where he went to high school, expressed shock in the aftermath of the shooting, remembering how Mr. Kelley was a friendly, if awkward, teenager who grew up active in his church. His senior yearbook photo shows him smiling, with untamed hair and a Hollister T-shirt. But in recent years, friends said, he grew so dark that many unfriended him on Facebook.
“I had always known there was something off about him. But he wasn’t always a ‘psychopath,’” a longtime friend, Courtney Kleiber, posted on Facebook on Sunday. “We had a lot of good times together. Over the years we all saw him change into something that he wasn’t. To be completely honest, I’m really not surprised this happened, and I don’t think anyone who knew him is very surprised either.”
Instead of straightening out after his bad conduct discharge, Mr. Kelley began a long downward slide that culminated in the shooting Sunday.
After getting out of confinement, Mr. Kelley moved into a barn at his parents’ house, which they had converted into an apartment, according to the local sheriff’s office records.
During the next two years, he was investigated twice for abusing women. The authorities in Comal County, which includes Mr. Kelley’s hometown New Braunfels, released records on Monday that showed he had been the subject of an investigation for sexual assault and rape in 2013.
The investigation ended without the filing of any charges — Mr. Kelley’s only skirmishes in the local courts were traffic violations.
Less than a year after the sexual assault report, deputies were summoned again after Mr. Kelley’s girlfriend at the time, Danielle Shields, reportedly sent a text message to a friend saying she was being abused. Deputies who responded told a dispatcher, according to the report, that it was a “misunderstanding and teenage drama.” Mr. Kelley married Ms. Shields two months later, local records show.
At the time of both episodes, Mr. Kelley’s appeals were still pending before military courts.
Mr. Kelley was finally discharged from the Air Force in 2014. He married Ms. Shields in April that year. Law enforcement officials described their relationship this week as “estranged.”
A few months after the wedding, the couple moved to Colorado Springs, where voter registration documents list his address as Parking Space 60 at a collection of trailers in a gravel lot called the Fountain Creek RV Park.
A woman living in a camper next door, who gave her name only as Susan, said a man of similar age and description lived in Spot 60 for a few months during that time.
“He was kind of off,” she said as she loaded blankets into one of the RV park’s washing machines.
He said hello a few times in passing but was never friendly and stayed only a few months, she said. She never heard any arguments from his trailer.
“The only thing that sticks out about him was his dog,” she said.
He had a puppy that he kept tied up in the sun all day outside his RV without water, she said. She also recalled an episode in which the police were called because he had struck the dog repeatedly in the head.
Records show Mr. Kelley was charged with cruelty to animals, a misdemeanor, in August 2014, pleaded guilty and was given a deferred sentence. He moved out a few weeks later, she said.
While in Colorado and Texas, Mr. Kelley purchased a number of guns at gun stores, according to law enforcement officials. On Monday, the Air Force admitted that it had failed to enter information from Mr. Kelley’s domestic violence court-martial into a federal database that could have blocked him from buying the weapon used in the church attack.
Mr. Kelley, whose father, Michael Kelley, is a computer programmer and accountant, enlisted in the Air Force soon after graduating from New Braunfels High School in 2009. Devin Kelley served as a low-ranking airman in a logistics readiness unit. A LinkedIn account in his name says he worked in cargo and distribution before his court-martial.
The account says that after the military, Mr. Kelley briefly worked as an aide at a youth Bible school in Kingsville, Tex., “helping their minds grow and prosper.”
Friends said on Facebook that in recent years, Mr. Kelley had become vocally anti-Christian, to the point where many stopped communicating with him. His Facebook page, which has been deleted, listed that he liked a number of atheist groups.
“He was always talking about how people who believe in God were stupid and trying to preach his atheism,” one of his Facebook friends, Nina Rosa Nava, posted on the site, saying she unfriended him because of it.
Law enforcement stopped short of saying religious views may have influenced Mr. Kelley, saying Monday that the shooting may have been motivated by a “domestic situation” involving Mr. Kelley’s estranged wife and her family.
Mr. Kelley never held jobs for long after the military. In June of this year, Mr. Kelley was hired as an unarmed night security guard at Schlitterbahn, a vast water park in New Braunfels. Less than six weeks later he was “terminated,” a spokeswoman for the park, Winter D. Prosapio, said Monday, adding, “He was not a good fit.”
By 2017, he had returned to a house in New Braunfels that records show was owned by his parents. The house was about an hour from the church where the shooting occurred. According to local law enforcement, Mr. Kelley’s second wife at times attended the church with members of her extended family.
The cover photo on Mr. Kelley’s Facebook page appears to show a Ruger 8515 rifle, equipped with additional aftermarket products, including a red-dot aiming sight for faster targeting and a two-stage trigger for greater accuracy.
Such rifles have been legal for civilians to own in most of the United States since the federal assault weapons ban expired in 2004, and have become popular among many firearms owners.
Mr. Kelley seemed enamored with the weapon. He posted a photograph of it on Oct. 29 with the caption “She’s a bad bitch.”
Law enforcement officials guarded the cactus- and rock-dotted Kelley property in New Braunfels on Monday morning, when the top of the house was just barely visible atop the tree line. A wire fence ran along the roadway.
Signs on a cattle gate at the entrance read “No Trespassing” and “Beware of Dog.”
Some neighbors said they sometimes heard gunfire from the property. But in this stretch of the Texas hill country, that is hardly cause for alarm.
One neighbor, who would give his name only as Doug, said he heard shots fired at the Kelley property that would set his dogs barking.
“My dogs, they would be outside, and we would hear, ‘Bim-bam, bim-bam, bim-bam, bim-bam,’” he said.