The Texas church shooter Devin Kelley killed a baby aged only 18 months during the massacre that killed at least 26 people on Sunday afternoon, police have announced.

A five-year-old was previously the youngest reported victim. The oldest of the 26 people killed in the attack was 77, authorities say. At least 20 others were injured in the shooting.

The attack occurred Sunday morning roughly 20 minutes after services were scheduled to start in the small white church in Sutherland Springs, Texas. The shooter reportedly entered the building wearing all black tactical gear, and a ballistics vest.

Kelley was seen at a gas station across the street just before the shooting began. He reportedly crossed the street and began shooting before entering the church. Authorities said that virtually nobody in the building emerged unscathed from the carnage.

The shooter was later engaged by an armed neighbour of the church, who reportedly wounded Kelley before chasing him 11 miles to the location where the killer crashed his truck. Authorities have indicated that Kelley had two gunshot wounds when they found him dead in his vehicle, and one of those wounds appeared to be self-inflicted. It was not immediately clear if the self-inflicted gunshot wound caused his death.

In the day after the attack, a troubling portrait of the killer's history has emerged. A former member of the US Air Force, the 26-year-old was court martialed in 2012 for assaulting his then-wife and her child. His first wife sued Kelley for divorce while he was serving a one-year prison term for that abuse. He was later discharged for bad-conduct, the second most severe discharge in the US military besides a dishonourable one.

Texas church shooting Show all 9 1 /9 Texas church shooting Texas church shooting The site of the mass shooting at First Baptist Church in Sutherland Springs, Texas Reuters Texas church shooting First responders are at the scene of shooting at the First Baptist Church Reuters Texas church shooting Enrique and Gabby Garcia watch investigators at the scene of the mass shooting AP Texas church shooting Law enforcement officials investigate the scene at the First Baptist Church in Sutherland Springs, Texas Reuters Texas church shooting Carrie Matula embraces a woman after a fatal shooting at the First Baptist Church in Sutherland Springs Associated Press Texas church shooting Law enforcement officials gather near the First Baptist Church Getty Images Texas church shooting Community members come together for a candlelight vigil for the victims of the deadly church shooting in Sutherland Springs Laura Skelding/AP Texas church shooting Mourners participate in the candlelight vigil held for the victims Jay Janner/Austin American-Statesman via AP Texas church shooting A vehicle is hauled onto a flatbed truck where the suspect in a deadly church shooting was found dead in Guadalupe County William Luther/Austin American-Statesman via AP

Former girlfriends described Kelley as an erratic and troubled individual who refused to leave them alone after their break ups. At least one has described him as having attempted to bribe her to spend time with him, and as having had stalked them.

"He was very sick in the head," Katy Landry, a former girlfriend of Kelley's who met him at church, told NBC News.

"Years after dating me he would try to bribe me to hang out with him," Landry continued. "He ended up assaulting me. He would stalk me by repeatedly calling me — even prank calling me, saying really weird stuff."

Kelley had purchased a Ruger AR-556 rifle in April of 2016 from an Academy Sports & Outdoors store in San Antonio, according to officials. Texas Governor Greg Abbott later indicated that the shooter had applied for a firearm license in the state, but had been denied. He had indicated on his background check forms when buying the AR-556 that he did not have a criminal history that would disqualify him from acquiring the weapon, and had listed a Colorado Springs, Colorado address as his primary residence, officials said.

"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,” Texas Governor Greg Abbott told CNN’s Chris Cuomo, citing the director of Texas' Department of Public Safety. “So how did this happen?”

A 1996 federal law prohibits gun sales to individuals with histories of domestic abuse from buying firearms. That law may have applied to Kelley, given his previous troubles while in the Air Force. His discharge would not necessarily have precluded him from buying a gun, as just dishonourable discharges expressly forbids gun purchases.

Officials did not immediately name a motive behind the attack, but potential clues began to emerge after the shooting. The in-laws of Kelley's second wife, for insstance, were known to attend the church he targeted, although they were not present for prayer Sunday morning. Kelley had also sent threatening messages to his mother-in-law, who had previously attended services at the church.

"We know that his ex- in-laws or in-laws came to church here from time to time," Wilson County Sheriff Joe Tackitt told CNN Monday. "They were not here yesterday. So we don't know why he actually showed up yesterday."

Kelley lived with his wife and their child at his parents' house in New Braunfels, Texas, just over 32 miles northeast of San Antonio. One neighbour said that he had seen Kelley around but did not remember anything sticking out about him as particularly strange. That neighbor indicated that he had heard the sound of gunshots on some evenings, but said it did not alarm him at the time given the area in rural Texas where gun ownership is very common.

Among those killed or injured in the attack were at least 14 children, including the death of the pastor's 14-year-old daughter. The pastor was travelling, and not present on the morning of the attack. As many as eight members of a single family were killed during the attack.