The gunman who shot dead 26 people, including an 18-month-old child, at a Texas church was only able to buy his weapons because the US Air Force failed to report his past convictions and court-martialing for abusing his wife and her child.

Officials broke Pentagon rules by failing to add Devin Patrick Kelley's 2012 domestic violence conviction and 2014 bad-conduct discharge to the federal database used to conduct background checks for potential gun buyers.

Kelley, 26, bought the first of four weapons in 2014 and carried three of them, a Ruger AR-15 and two handguns, in Sunday's attack on a small church outside San Antonio that was the worst ever mass shooting in Texas history.

The FBI is investigating the worst ever mass shooting in Texas history. Credit: AP

The dead ranged from 18 months to 77 years old and included several members of the same families who had attended a service at the First Baptist Church in Sutherland Springs.

After fleeing the church, Kelley, who was dressed in black, was pursued in a 90mph chase by two men later hailed by authorities as "two good Samaritans".

Stephen Willeford, a 55-year-old former National Rifle Association instructor, heard the shooting at home and grabbed his rifle before running barefoot and jumping in a stranger's pickup truck that was stopped at a junction.

Johnnie Langendorff, left, and Stephen Willeford pursued the gunman. Credit: AP

The driver, Johnnie Langendorff, chased Kelley while the pair reported their movements to police before the attacker's car collided with a road sign and flipped into a ditch.

Police arrived a few minutes later with Kelley engaged in a stand-off, during which it is understood he took his own life.

Officials said he suffered three gunshot wounds; to the leg, torso and the self-inflicted shot to the head.

"I didn’t want this and I want the focus to be on my friends,” Willeford later told the Dallas Morning News. "I have friends in that church. I was terrified while this was going on."

A makeshift memorial with crosses has been placed near the scene of Sunday's shooting. Credit: AP

Langendorff said: "I did what I did because it was the right thing to do."

Authorities said 10 people remain in critical condition and four are in serious condition, while a vigil to honour three students killed and six injured is being planned for Wednesday night.

The Air Force said it is launching a review of its handling of Kelley's case and will re-examine whether other cases have been reported correctly.

An initial review indicates Kelley's conviction was not entered into the federal database by officials at Holloman Air Force Base in New Mexico, where Kelley served from 2010 until his discharge.

The Holloman Air Force Base in New Mexico, where Devin Patrick Kelley moved passengers and cargo. Credit: AP

A US federal law, the Lautenberg Amendment, passed in 1996 was specifically designed to prevent people convicted of domestic violence from buying or possessing a firearm.

"This is exactly the guy the Lautenberg Amendment is supposed to prevent from possessing a firearm," said Rachel VanLandingham, a professor at Southwestern Law School in Los Angeles and a retired Air Force lieutenant colonel and former judge advocate.

"Of course, the law only works if folks are abiding by the law."

Lindsay Nichols, the US federal policy director at the Giffords Law Centre to Prevent Gun Violence, condemned the Air Force's failure to raise the alarm.

"The fact this guy was even court martialled at all indicates it reached a certain level of severity that should act as a red flag that this is a dangerous person and shouldn't have a gun," she said.