"There was a domestic situation going on within the family and the in-laws," Xinhua news agency quoted Freeman Martin, a spokesman for the Texas Department of Public Safety, as telling the media outside the church in Sutherland Springs, about 65 km east of San Antonio.
He said that the suspect, identified as Devin Patrick Kelley, sent threatening text to his mother-in-law in the morning before launching the shooting attack.
"The mother-in-law attended the church. We know he sent threatening ... that she had received threatening text messages from him."
"The domestic situation will continue to be thoroughly investigated. This was not racially motivated," Martin said.
Texas Governor Greg Abbott said on Sunday that at least 26 people were killed after the gunman opened fire at the church in Sutherland Springs, a community of fewer than 400 residents.
The attack in the church was the deadliest mass shooting in the state's history, he added.
The lone gunman, dressed in black tactical gear and a ballistic vest, drove up to the First Baptist Church in Sutherland Springs at around 11:30 a.m. on Sunday and started firing inside.
As he left the church, a local resident grabbed his rifle and engaged with the suspect, Martin said.
The gunman, 26, was later found dead nearby in his car, apparently of a gunshot wound, after he fled the scene.