POWAY, Calif. — The rabbi had just finished comforting a congregant as she prepared to say the traditional prayer for the dead in honor of her mother when a loud crack rang out in his synagogue.

It was about halfway through the Sabbath service on Saturday when a gunman turned what was supposed to be a time of solace into a day of horror. The rabbi, Yisroel Goldstein, turned quickly to see the body of the woman, Lori Gilbert Kaye, 60, slumped on the floor. He began to rush toward her when he caught sight of several small children watching as the gunman unleashed the attack on Chabad of Poway.

“My instinct was to go to her, but I turned toward a doorway and these little kids were there, so scared,” he said. By then, Rabbi Goldstein had been shot in both hands. “I just grabbed them with my bloody fingers. They were screaming and I was shouting.”

As Rabbi Goldstein ran out with the children, Ms. Kaye’s husband, a physician, ran in to help. But the second he recognized it was his wife on the ground, he fainted. Their only daughter stood a few feet away sobbing in shock, Rabbi Goldstein said.