The gunman who carried out a massacre at a small-town Texas church on Sunday (05) was involved in a family dispute, authorities said.

Twenty-six people were killed and 20 wounded in the shooting, which took place during a Sunday morning service.

“There was a domestic situation going on,” Freeman Martin, a spokesman for the Texas Department of public safety, said at a press conference near the scene of the shooting in Sutherland Springs, about 35 miles east of San Antonio.

Martin said the named gunman, Devin Kelley, sent threatening texts to his mother-in-law. She had attended the First Baptist church in the past but was not there on Sunday.

Martin said the 26-year-old Kelley, who lived in New Braunfels, about 35 miles north of Sutherland Springs, was “engaged” by a civilian with an AR rifle – a “Texas hero”, he said – who flagged down a motorist, jumped into his vehicle and chased Kelley, who was found dead in his SUV.

Martin said the suspect made a call on a cellphone to tell his father he had been shot and did not think he was going to make it.

Later, Martin said that an autopsy on the shooter’s body found three gunshot wounds – two from the armed citizen, one in the leg and in the torso – and a third in the head, consistent with being self-inflicted.

At least 15 magazines with a 30-round capacity have been recovered from the scene, the spokesperson said.

It was revealed that the Air Force did not enter the record of Kelley’s domestic abuse conviction into the national background check system which, according to an air force spokesperson, would have prohibited him from buying or owning firearms.

Kelley was not licensed to carry a firearm openly or in a concealed fashion in public in Texas. But he did have an unarmed private security license “similar to a security guard at a concert”, Martin said. That meant he passed criminal background and fingerprint checks.