Texas church gunman Devin Patrick Kelley had three guns and had been involved in a row with his mother-in-law, officials have said.
The attack on the small church outside of San Antonio during Sunday services left 26 people dead and 20 injured.
The gunman called his father after he was shot by an armed bystander, and said he did not think he would survive.
Kelley was not legally permitted to own the weapons, which included a semi-automatic rifle and two handguns.
Freeman Martin, the regional director for the Texas Department of Public Safety, told reporters it appeared that Kelley died from a self-inflicted gunshot wound after first being shot by a "Good Samaritan".
"This was not racially motivated, it wasn't over religious beliefs," Martin said.
"There was a domestic situation going on with the family and in-laws," he said, adding that the mother-in-law had received threatening text messages from Kelley in recent days.
Wilson County Sheriff Joe Tackitt said that the family members had not been present at the time of attack.
Officials have not yet identified the victims in the small town of Sutherland Springs.
Ten of the injured victims are in hospital in critical condition, with officials warning that the death toll could rise.
Kelley was court-martialed in 2012 after he was accused of assault against his wife and child. He was sentenced to 12 months confinement.
He received a "bad conduct" discharge two years later, according to Ann Stefanek, a US Air Force spokeswoman.
Texas Governor Greg Abbott said on Monday: "It's clear this is a person who had violent tendencies, who had some challenges, and someone who was a powder keg, seeming waiting to go off."
Abbott added that the attacker should not legally have been allowed to own a firearm, after having been denied a gun owner's permit by the state.
The suspect had a licence to work as an unarmed security guard, a job that police described as "similar to a security guard at a concert-type situation".
"There were no disqualifiers entered into the national crime information database to preclude him from receiving a private security licence," Martin said.
The shooting comes just a month after a gunman in Las Vegas opened fire on an outdoor music festival, killing 58 people and wounding hundreds in the deadliest mass shooting in recent US history.