The man who went on a shooting spree at a church in Texas this weekend had previously escaped from a mental hospital in New Mexico, reports show.

He had been institutionalized after beating his then-wife and her child in 2012 while stationed at Holloman Air Force Base, but was able to escape and flee the state to Texas in 2012, documents obtained by local media.

In a missing person report filed after his escape, the shooter was described as "a danger to himself and others as he had already been caught sneaking fire arms onto Hollomon Air Force Base" where he was "attempting to carry out death threats" he had made to his chain of command. The US Air Force refused to confirm that the shooter had escaped from a mental institution in 2012, citing privacy rules under the Health Insurance Portability and Accountability Act of 1996.

Devin Kelley, 26, killed 26 people Sunday and wounded at least 20 more in at the First Baptist Church in Sutherland Springs, Texas. In the days that have followed that attack, reports have emerged describing him as a deeply disturbed man with a history of domestic violence and animal abuse who stalked former girlfriends and attempted to force them to spend time with him. The youngest victim of the attack was an 18-month-old child, while the oldest was a 77-year-old. Virtually nobody in the church emerged unscathed from the attack.

The shooter was convicted in a military court in 2012 of beating his then-wife and child, and sentenced to a years' prison sentence before he was discharged on bad behaviour. During the beatings, he had fractured the skull of the child, who was born in 2010. The beatings began roughly one year after the child was born, according to officials.

The abused wife filed for divorce while her ex husband was in jail.

Texas shooting in pictures Show all 21 1 /21 Texas shooting in pictures Texas shooting in pictures Texas shooting in pictures A view of debris of a car blown up by police as a precaution near the Curtis Culwell Center. Getty Images Texas shooting in pictures Texas shooting in pictures FBI agents view the area where the shooting suspects lay behind a blue covering. Getty Images Texas shooting in pictures Texas shooting in pictures Police officers block an intersection near the Curtis Culwell Center after a shooting outside the Muhammad Art Exhibit and Contest. Reuters Texas shooting in pictures Texas shooting in pictures Garland Police spokesperson Joe Harn pauses as he addresses media about the shooting at the Curtis Culwell Center. AP Texas shooting in pictures Texas shooting in pictures A police officer stands near a vehicle after a shooting outside the Muhammad Art Exhibit and Contest. Reuters Texas shooting in pictures Texas shooting in pictures Police officers address attendees at the Muhammad Art Exhibit and Contest after they are prevented from leaving when shots were fired at the exhibit in Garland. Reuters Texas shooting in pictures Texas shooting in pictures An armed police officer stands guard on a road near the Curtis Culwell Center. AP Texas shooting in pictures Texas shooting in pictures Police stand guard near the shooting suspects pickup truck, after two men drove up and started shooting at police. EPA Texas shooting in pictures Texas shooting in pictures The suspects' vehicle Fox News Texas shooting in pictures Texas shooting in pictures Twitter suspends account that warned about a 'Texas attack' 15 minutes before incident at anti-Muslim event. Twitter Texas shooting in pictures Texas shooting in pictures The car is getting searched for explosion damage. Twitter/Fox4Terry Texas shooting in pictures Texas shooting in pictures Security guard Bruce Joiner was shot in the leg while standing outside the venue. He's recovering. Twitter Texas shooting in pictures Texas shooting in pictures A policeman keeps members of the audience inside after reports of shots fired outside EPA Texas shooting in pictures Texas shooting in pictures Garland police spokesman Joe Harn (centre) addresses the media near the Curtis Culwell Center after the shooting. Reuters Texas shooting in pictures Texas shooting in pictures A police officer stands near a school bus used to evacuate attendees of the Muhammad Art Exhibit and Contest. Reuters Texas shooting in pictures Texas shooting in pictures A person in the audience listens to Dutch member of parliament and leader of the far-right Party for Freedom, Geert Wilders delivering the keynote address at the Muhammad Art Exhibit . EPA Texas shooting in pictures Texas shooting in pictures A police officer directs the evacuation of attendees of the Muhammad Art Exhibit and Contest, after a shooting outside the Curtis Culwell Center where the event was held in Garland, Texas on 3 May. Reuters Texas shooting in pictures Texas shooting in pictures A police officer prevents attendees from leaving the Muhammad Art Exhibit and Contest after shots were fired outside the venue in Texas. Reuters Texas shooting in pictures Texas shooting in pictures Political blogger Pamela Geller, president of American Freedom Defense Initiative speaks at the event. Reuters Texas shooting in pictures Texas shooting in pictures Officers in Garland, Texas, after a two men opened fire at a Prophet Mohammad cartoon exhibition. AP Texas shooting in pictures Texas shooting in pictures Dutch member of parliament and leader of the far-right Party for Freedom, Geert Wilders delivers the keynote address at the event. EPA

After his release from military prison, the future shooter moved into a barn on his parents' property in New Braunfels, Texas. Over the next couple of years, he was investigated twice for abusing women. Records show that he was investigated in 2013 for sexual assault and rape.

Military officials have indicated that Kelley should not have been able to purchase a firearm because of his prior domestic violence conviction, but he was able to slip through the cracks because the military failed to pass along information related to the case to the FBI, which processes federal background checks. That lack of communication between the military is not an isolated incident, and the military has reportedly known for decades that the military records were often not sent over to the federal agency tasked with ensuring guns don't make it into the hands of criminals.

Kelley reportedly bought an assault-style rifle in April of last year from a gun store in San Antonio. He said on that form that he did not have a criminal background that would preclude him from gun ownership, and listed a Colorado Springs, Colorado address as his primary place of residence. Police reports indicate that he had been questioned by police for beating a dog in Colorado, after neighbours reported him for repeatedly punching a dog before body slamming it to the ground.

Past girlfriends have described the shooter as a troubled individual who refused to leave them alone. One said that he had essentially attempted to bribe her into spending time with him years after they broke off their relationship. One said that she was 13-years-old when she dated Kelley, who was 18 at the time.

Officials refrained from assigning a motive for the shooting in its immediate aftermath, but these details and others have provided clues to why Kelley may have decided to don tactical gear and shoot up a church. One of the casualties of the attack was his wife's grandmother, it was later learned. Kelley had reportedly threatened his mother-in-law, who had attended the church previously, in the past. The mother-in-law was not present at the time of the shooting.

More than a dozen children were killed during the attack, including the 14-year-old daughter of the church's pastor, who was out of town at the time.