A member of the security team was killed in the attack, he said.

Mike Tinius, an elder at the church, said he had known that victim for more than 20 years. “He was trying to do what he needed to do to protect the rest of us,” Mr. Tinius said, adding, “It’s extremely upsetting to see anyone committing violence.”

The shooting, which the authorities said lasted six seconds, was captured on video because the church regularly posts its services online.

In the video, the gunman stands up during a quiet moment and briefly talks with someone standing against a wall. He then begins firing. Congregants crouch down in their pews. After a third loud bang, the gunman slumps to the ground as people scream.

“He was immediately hit by one of our marksmen,” Mr. Cummings said. “The next thing I know, he was lying on the floor.”

The authorities did not release the names of the two parishioners who had been killed or the gunman, whom the F.B.I. special agent in charge of Dallas described as a transient person with roots in the area. The agent, Matthew J. DeSarno, said the investigation into a motive was continuing.