The Texas gunman Devin Patrick Kelley had argued with his mother-in-law who attended the First Baptist Church in Sutherland Springs before the rampage, officials said on Monday.
He is accused of killing 26 people including an 18-month-old child at the small Texas church. Before the massacre he had sent threatening text messages to his in-laws who sometimes went to the house of worship before launching the latest US mass shooting.
'There was a domestic situation going on within the family and the in-laws,' Freeman Martin, a spokesman for the Texas Department of Public Safety, told reporters. 'The mother-in-law attended the church. We know he sent threatening ... that she had received threatening text messages from him.'
The gunman, Devin Patrick Kelley, was court-martialed in 2012 on charges of assaulting his wife and child and sentenced to 12 months confinement. He received a 'bad conduct' discharge in 2014, according to Ann Stefanek, the chief of Air Force media operations.
Kelley, 26, walked into the white-steepled First Baptist Church in rural Sutherland Springs on Sunday carrying a Ruger AR-556 assault rifle and wearing a black bulletproof vest, then opened fire during prayer service. He wounded at least 20 others, officials said.
After he left the church, two local residents, including one who was armed, chased Kelley in a truck and they exchanged gunfire. The chase ended when Kelley crashed his car, and may have died of a self-inflicted gunshot wound or from the Good Samaritan's weapon, said Martin.
An autopsy will determine the cause of death, Martin said.
Wilson County Sheriff Joe Tackitt said in an interview that the family members had not been present at the time of Kelley's attack
'I heard that (the in-laws) attended church from time to time,' Tackitt said. 'Not on a regular basis.'
The attack, which killed people ranging from 18 months to 77 years old, came a little more than a month after a gunman killed 58 people in Las Vegas in the deadliest shooting by a sole gunman in US history.
The initial death toll matched the fatalities at Sandy Hook Elementary School in Newtown, Connecticut, where a man shot and killed 26 children and educators and his mother before taking his own life in December 2012. Those attacks now stand as the fourth deadliest by a single gunman in the United States.
Officials warned that 10 of the wounded remained in critical condition on Monday morning.
Additional reporting by Reuters.