A local resident grabbed his own rifle and engaged the gunman, said Freeman Martin, the regional director of the Texas Department of Public Safety.

“The suspect dropped his rifle, which was a Ruger AR assault-type rifle and fled from the church,” Martin said.

The manthen chased the gunman, Martin said.

He was just driving by

A witness, Johnnie Langendorff, said he was driving by the church on the way to his girlfriend’s house when he saw gunfire between the shooter and the armed resident.

Langendorff told CNN affiliate KSAT he didn’t get a good look at the shooter, other than he was dressed in all black. But the shooter was taking off and the armed resident “briefed me quickly on what had just happened and said we had to get him, and so that’s what I did.”

They gave chase in his truck for 11 miles and called police dispatch to tell them where they were and what direction they were headed.

“The vehicle was in sight and I was picking up, getting closer and closer to it. We hit about 95 (mph) … trying to catch this guy until he eventually lost control on his own and went off into the ditch,” Langendorff told the station.

“The gentleman that was with me got out and rested his rifle on my hood and kept it aimed at him (the shooter), telling him to get out. There was no movement, there was none of that. I just know his brake lights were going on and off, so he might’ve been unconscious from the crash or something like that. I’m not sure.”

Langendorff felt the suspect, who crashed his pearl-colored Ford Explorer near the county line, “just gave up.”

When police — who arrived about five minutes later — went to the suspect’s vehicle, they found the gunman inside dead of a bullet wound. He was later identified as Devin Patrick Kelley.

“At this time, we don’t know if it was a self-inflicted gunshot wound or if he was shot by the local resident,” Martin said.

The shooting was a horrific tragedy, Landendorff said, but he hopes the families of the victims can sleep better knowing the shooter “was taken care of.”

And he has no regrets about throwing himself into such a dangerous situation.

“He just hurt so many people, and he just affected so many people’s lives,” he told KSAT. “Why wouldn’t you want to take him down?”

Bravery seen at another church shooting

Authorities didn’t offer additional details, nor identify the resident or the gunman. They will likely elaborate more in subsequent media briefings.

“They are continuing in their efforts as they put all the pieces of a very complex puzzle together to try to provide their community all the answers they need and deserve,” Texas Gov. Greg Abbott said.

The shooting at the church claimed 26 lives. Twenty-three of the dead were found dead inside the church, officials said.

The Sutherland Springs resident’s actions echoed another man’s act of bravery during a different church shooting earlier this year in Antioch, Tennessee.

As the service at the Burnette Chapel Church of Christ was ending on September 24, a gunman — whom police identified as 25-year-old Emanuel Kidega Samson — entered the church with a pair of pistols and started firing. An usher at the church, Robert Engle, sprang into action — struggling with the suspect, even as he was being pistol-whipped, police said.

“Mr. Samson didn’t expect Mr. Engle to encounter him, to struggle with him, to try to stop the shooting,” said Don Aaron, the spokesman for the Metropolitan Nashville Police Department.

During the altercation, the gunman accidentally shot himself in the chest with his own weapon, police said.

When the gunman fell, Engle, despite his head injuries, ran to his car and came back with a pistol of his own, police said.

Engle, who has a permit for a handgun, then made sure Samson stayed on the ground until officers arrived, Aaron said.