US President Donald Trump has called the Texas church shooting a 'mental health problem at the highest level' and the said the gunman was 'deranged'.

The comments come after a gunman with an assault rifle stormed a church in rural Texas on Sunday, killing at least 26 worshippers and wounding 20 others in a rampage to be notched into a litany of mass shootings that have plagued the United States in recent years.

The lone suspect, dressed in black tactical gear and a ballistic vest, drove up to the white-steepled First Baptist Church in Sutherland Springs during Sunday morning services and started firing inside. He kept shooting once he entered, killing or wounding victims ranging in age from five to 72 years old, law enforcement officials told a news conference.

Among the dead was the 14-year-old daughter of Pastor Frank Pomeroy, the family told several television stations.

The gunman was later found dead, apparently of a gunshot wound, after he fled the scene.

"We are dealing with the largest mass shooting in our state's history," Texas Governor Greg Abbott said at the news conference. "The tragedy of course is worsened by the fact that it occurred in a church, a place of worship where these people were innocently gunned down."

The massacre appeared to shake the close-knit community to its core. About 40 miles (65km) east of San Antonio in Wilson County, Sutherland Springs has fewer than 400 residents.

"This would never be expected in a little county like Wilson County," Texas Attorney General Ken Paxton told CNN.

After leaving the church, the gunman was fired on by a local resident with a rifle. The suspect dropped his Ruger assault weapon and fled in his vehicle, said Freeman Martin, regional director of the Texas Department of Public Safety.

Soon afterward, the suspect crashed the vehicle near the border of a neighbouring county and was found dead inside with a cache of weapons. It was not immediately clear if he killed himself or was hit when the resident fired at him outside the church, authorities said.

The suspect's identity was not disclosed by authorities, but law enforcement officials who asked not to be named said he was Devin Patrick Kelley, described as a white, 26-year-old man, the New York Times and other media reported.

"We don't think he had any connection to this church," Wilson County Sheriff Joe Tackitt told CNN. "We have no motive."

Jeff Forrest, a 36-year-old military veteran who lives a block away from the church, said what sounded like high-calibre, semi-automatic gunfire triggered memories of his four combat deployments with the Marine Corps.

"I was on the porch, I heard 10 rounds go off and then my ears just started ringing," Forrest said. "I hit the deck and I just lay there."

The massacre came just weeks after a sniper killed 58 people at an outdoor concert in Las Vegas, the deadliest mass shooting in modern US history.

The shootings have stirred a years-long national debate over whether easy access to firearms was contributing to the trend.

In rural areas like Sutherland Springs, gun ownership is a part of life and the state's Republican leaders for years have balked at pushes for gun control, arguing that more firearms among responsible owners makes the state safer.

To honour the victims, President Donald Trump ordered flags on all federal buildings to be flown at half staff.

"This act of evil occurred as the victims and their families were in their place of sacred worship," the president said in Tokyo during the first leg of a 12-day Asian trip. "Through the tears and through the sadness we stand strong, oh so strong."

The First Baptist Church is one of two houses of worship in Sutherland Springs. There are also two gas stations and a Dollar General store in town.

Texas church shooting Show all 9 1 /9 Texas church shooting Texas church shooting The site of the mass shooting at First Baptist Church in Sutherland Springs, Texas Reuters Texas church shooting First responders are at the scene of shooting at the First Baptist Church Reuters Texas church shooting Enrique and Gabby Garcia watch investigators at the scene of the mass shooting AP Texas church shooting Law enforcement officials investigate the scene at the First Baptist Church in Sutherland Springs, Texas Reuters Texas church shooting Carrie Matula embraces a woman after a fatal shooting at the First Baptist Church in Sutherland Springs Associated Press Texas church shooting Law enforcement officials gather near the First Baptist Church Getty Images Texas church shooting Community members come together for a candlelight vigil for the victims of the deadly church shooting in Sutherland Springs Laura Skelding/AP Texas church shooting Mourners participate in the candlelight vigil held for the victims Jay Janner/Austin American-Statesman via AP Texas church shooting A vehicle is hauled onto a flatbed truck where the suspect in a deadly church shooting was found dead in Guadalupe County William Luther/Austin American-Statesman via AP

The white-painted, one-story structure features a small steeple and a single front door. On Sunday, the Lone Star flag of Texas was flying alongside the US flag and a third, unidentified banner.

Inside, there is a small raised platform on which members sang worship songs to guitar music and the pastor delivered a weekly sermon, according to videos posted on YouTube. In one of the clips, a few dozen people, including young children, can be seen sitting in the wooden pews.

It was not clear how many worshipers were inside when the shooting occurred on Sunday.