SUTHERLAND SPRINGS, Texas — A man dressed in black tactical-style gear and armed with an assault rifle opened fire inside a church in a small South Texas community on Sunday, killing 26 people and wounding about 20 others in what Gov. Greg Abbott called the deadliest mass shooting in the state’s history. The dead ranged in age from 5 to 72 years old.

Authorities didn’t identify the attacker during a news conference Sunday night, but two other officials — one a U.S. official and one in law enforcement — identified him as Devin Kelley, 26. They spoke to The Associated Press on the condition of anonymity because they weren’t authorized to discuss the investigation.

The U.S. official said Kelley lived in a San Antonio suburb and didn’t appear to be linked to organized terrorist groups. Investigators were looking at social media posts Kelley made in the days before Sunday’s attack, including one that appeared to show an AR-15 semiautomatic weapon.

An Air Force spokeswoman said Sunday night that Devin P. Kelley received a bad-conduct discharge from the Air Force for allegedly assaulting his spouse and child, and was sentenced to 12 months’ confinement after a 2012 court-martial. Kelley served in Logistics Readiness at Holloman Air Force Base in New Mexico from 2010 until his discharge, spokeswoman Ann Stefanek said.

At the news conference, the attacker was described only as a white man in his 20s who was wearing black tactical gear and a ballistic vest when he pulled into a gas station across from the First Baptist Church around 11:20 a.m.

The gunman crossed the street and started firing a Ruger AR rifle at the church, said Freeman Martin, a regional director of the Texas Department of Safety, then continued firing after entering the white wood-frame building, where an 11 a.m. service was scheduled. As he left, the shooter was confronted by an armed resident who “grabbed his rifle and engaged that suspect,” Martin said. A short time later, the suspect was found dead in his vehicle at the county line.

Several weapons were found inside the vehicle and Martin said it was unclear if the attacker died of a self-inflicted wound or if he was shot by the resident who confronted him. He said investigators weren’t ready to discuss a possible motive. Martin said 23 of the dead were found in the church, two were found outside and one died after being taken to a hospital.

Several weapons were found inside the vehicle and Martin said it was unclear if the attacker died of a self-inflicted wound or if he was shot by the resident who confronted him. He said investigators weren’t ready to discuss a possible motive. Martin said 23 of the dead were found in the church, two were found outside and one died after being taken to a hospital.

Addressing the news conference, Gov.Abbott called the attack the worst mass shooting in Texas history.

“There are no words to describe the pure evil that we witnessed in Sutherland Springs today,” Abbott said. “Our hearts are heavy at the anguish in this small town, but in time of tragedy, we see the very best of Texas. May God comfort those who’ve lost a loved one, and may God heal the hurt in our communities.”

Among those killed was the church pastor’s 14-year-old daughter, Annabelle Pomeroy. Pastor Frank Pomeroy, and his wife, Sherri, were both out of town in two different states when the attack occurred, Sherri Pomeroy wrote in a text message to the AP.

“We lost our 14-year-old daughter today and many friends,” she wrote. “Neither of us has made it back into town yet to personally see the devastation. I am at the charlotte airport trying to get home as soon as i can.”

Federal law enforcement swarmed the small rural community of a few hundred residents 30 miles southeast of San Antonio after the attack, including ATF investigators and members of the FBI’s evidence collection team.

At least 16 wounded were taken to hospitals, hospital officials said, including eight taken by medical helicopter to the Brooke Army Medical Center. Another eight victims were taken to Connally Memorial Medical Center, located in Floresville about 10 miles from the church, including four who were later transferred to University Hospital in San Antonio for higher-level care, said spokeswoman Megan Posey.

Hunter Green, 16, normally attends the church with his girlfriend but they skipped Sunday after a late date night. Attending a candlelight vigil hours later, he described the building as having only small exits on the side and in the back that would have made it very difficult to flee a shooter entering the front door.

“They wouldn’t have had anywhere to go,” Green said.

Alena Berlanga, a Floresville resident who was monitoring the chaos on a police scanner and in Facebook community groups, said everyone knows everyone else in the sparsely populated county.

“This is horrific for our tiny little tight-knit town,” Berlanga said. “Everybody’s going to be affected and everybody knows someone who’s affected.”

Regina Rodriguez, who arrived at the church a couple of hours after the shooting, walked up to the police barricade and hugged a person she was with. She said her father, 51-year-old Richard Rodriguez, attends the church every Sunday, and she hadn’t been able to reach him. She said she feared the worst.

Church member Nick Uhlig, 34, wasn’t at Sunday’s service, but he said his cousins were at the church and that his family was told at least one of them, a woman with three children and pregnant with another, was among the dead.

“We just gathered to bury their grandfather on Thursday,” he said, shaking his head. “This is the only church here. We have Bible study, men’s Bible study, vacation Bible school. Somebody went in and started shooting.”

President Donald Trump, who was in Japan, called the shooting an “act of evil” and said he was monitoring the situation.

May God be w/ the people of Sutherland Springs, Texas. The FBI & law enforcement are on the scene. I am monitoring the situation from Japan. — Donald J. Trump (@realDonaldTrump) November 5, 2017

Abbott tweeted Sunday: “Our prayers are with all who were harmed by this evil act.” He thanked law enforcement for their response.

“We’re shocked. Shocked and dismayed,” said state Sen. Judith Zaffirini, a Laredo Democrat whose district includes Sutherland Springs, a rural community known for its peanut festival, which was held last month. “It’s especially shocking when it’s such a small, serene area.

Later Sunday, two sheriff’s vans were parked outside the gate of a cattle fence surrounding the address listed for Kelley on the rural, western outskirts of New Braunfels, north of San Antonio, preventing a group of waiting journalists from entering. Officials from the Comal County Sheriff’s Office and the Texas Rangers declined to comment or say if they had raided his home.

Sutherland Springs is in a rural area where communities are small and tight-knit. The area is known for its annual peanut festival in Floresville, which was most recently held last month.

“We’re shocked. Shocked and dismayed,” said state Sen. Judith Zaffirini, a Laredo Democrat whose district includes Sutherland Springs. “It’s especially shocking when it’s such a small, serene area. These rural areas, they are so beautiful and so loving.”

Later Sunday, two sheriff’s vans were parked outside the gate of a cattle fence surrounding the address listed for Kelley on the rural, western outskirts of New Braunfels, north of San Antonio, preventing a group of waiting journalists from entering. Officials from the Comal County Sherriff’s Office and the Texas Rangers declined to comment or say if they had raided his home.

Ryan Albers, 16, who lives across the road, said he heard intensifying gunfire coming from that direction in recent days.

“It had to be coming from somewhere pretty close,” Albers said. “It was definitely not just a shotgun or someone hunting. It was someone using automatic weapon fire.”

The church has posted videos of its Sunday services on a YouTube channel, raising the possibility that the shooting was captured on video.

In a video of its Oct. 8 service, a congregant who spoke and read Scripture pointed to the Oct. 1 Las Vegas shooting a week earlier as evidence of the “wicked nature” of man. That shooting left 58 dead and more than 500 injured.

Until Sunday, the deadliest mass shooting in Texas had been a 1991 attack in Killeen, when a mentally disturbed man crashed his pickup truck through a restaurant window at lunchtime and started shooting people, killing 23 and injuring more than 20 others.

The University of Texas was the site of one of the most infamous mass shootings in American history, when U.S. Marine sniper Charles Whitman climbed the Austin campus’ clock tower in 1966 and began firing on stunned people below, killing 13 and wounding nearly three dozen others. He had killed his wife and mother before heading to the tower, one victim died a week later and medical examiners eventually attributed a 17th death to Whitman in 2001.

Associated Press writers Sadie Gurman and Eric Tucker in Washington, Nomaan Merchant in Houston, Will Weissert in Austin, Diana Heidgerd in Dallas, Michael Balsamo in Los Angeles and Paul J. Weber in New Braunfels, Texas, contributed to this report.