A law enforcement official stands watch outside the First Baptist Church of Sutherland Springs, the scene of a deadly shooting in Sutherland Springs, Texas. Picture: Eric Gay/AP

Washington - The gunman who massacred 26 people in Texas had sent threatening text messages to his wife's mother before opening fire at a church where his in-laws had worshipped, authorities said Monday.

"We know that he expressed anger toward his mother-in-law, who attends this church," Freeman Martin, Texas Department of Public Safety regional commander, told reporters.

"This was not racially motivated. It wasn't over religious beliefs. It was a domestic situation going on with the in-laws."

The shooting occurred during a service on Sunday at First Baptist Church in Sutherland Springs, home to only a few hundred people, about 48 kilometres south-east of San Antonio.

Read: #TexasChurchMassacre: Gunman had history of disturbing behaviour

The dead ranged in age from 18 months to 77 years, and 20 people were injured. Among the wounded, 10 were in critical condition and four remained hospitalized in serious condition.

FBI special agent Chris Combs said federal authorities were assisting Texas police but "at this time we do not have a terrorism investigation open" in the absence of political motives or ties to militant groups.

The suspect, Devin Kelley, 26, of nearby New Braunfels, Texas, about 50 kilometres north of the church, was seen at a petrol station across the street from the church on Sunday morning, dressed in black and wearing body armour.

Also read: Witnesses tell of terror, fear during #TexasShooting

He drove to the church and opened fire before going inside. Two people were killed outside the building and 23 inside. Another victim later died at a hospital.

The gunman, who was wearing a black mask imprinted with a white skull, dropped his rifle, a military style AR-15, and fled by car after being wounded by an armed neighbour who confronted him outside the church, Martin said.

Driving away while pursued by two "good Samaritans" - the neighbour and a passing driver - the gunman telephoned his father to say that he had been shot "and didn't think he was going to make it," Martin said.

A postmortem examination has been conducted on the gunman, and evidence at the scene where the car was stopped "indicates the subject may have died from a self-inflicted gunshot wound," Martin said.

Two handguns were recovered from the car.

Sutherland Springs has been described as a community with two petrol stations, two churches, one store and a post office.

In 2012, Kelley, a licensed unarmed security guard and former Air Force airman, was court-martialled and convicted of domestic violence, and he received a bad conduct discharge.

An agent from the Bureau of Alcohol, Tobacco, Firearms and Explosives said that records show Kelley had purchased four firearms since 2014 in multiple states.

Texas Governor Greg Abbott called the massacre the "largest mass shooting in the state's history."

President Donald Trump said he was following developments from Japan, where he was on a five-country Asia tour. He called the shooting a "mental health problem at the highest level."