The rabbi of the San Diego-area synagogue targeted by a gunman over the weekend managed to save his congregation and prevent a massacre, relatives say.

On Saturday, 19-year-old San Diego man John T. Earnest burst into the Chabad of Poway synagogue north of San Diego and opened fire on congregants.

Four people were wounded in the attack, one of them - 60-year-old Lori Gilbert Kaye – fatally.

Among the wounded was 57-year-old Rabbi Yisroel Goldstein, the spiritual leader of the congregation.

In newly revealed details of the shooting attack, it appears that Rabbi Goldstein was instrumental in preventing Earnest from carrying out a massacre at the synagogue.

According to his sister, Rabbi Goldstein managed to hold the gunman’s semiautomatic rifle at the entrance to the synagogue, preventing him from shooting directly at the congregation.

"Yisroel was coming out of the bathroom, washing his hands, getting ready for Yizkor. As he's coming out to wash his hands, he sees this maniac in the foyer. He wasn't even in the shul [synagogue] yet. He had just walked in the hall - the shooter - and Yisroel sees suddenly that this maniac just shot - he just saw this lady fall down, the one that he killed.”

“Yisroel looks at him and grabs with his two hands the gun to stop him from continuing to shoot, because he was about to continue shooting in the shul [synagogue]. So Yisroel is actually a hero. He protected his shul. He grabbed the gun, holding onto it tight. The guy shot the gun, and it actually ripped off his two middle fingers. So he was in surgery for about eight hours today, and they're no longer able to do anything for his fingers - he's missing those fingers. He gave that up to protect his shul."

"When he grabbed the gun as the shooter was ready to shoot at Yisroel, the gun jammed after it shot his fingers. In that moment of the jam, whoever was standing nearby was an off-duty police officer who came to say Yizkor. He grabbed his gun and immediately started chasing the shooter out of the shul, until the shooter got into his car."

"Yisroel stopped further shootings in his shul. He happened to be there at that moment. He said it was a miracles upon miracles, because kids were running all over."

In addition to Lori Gilbert Kaye, who was fatally wounded in the attack, and Rabbi Goldstein, who lost two of his fingers, two Israeli immigrants to the US were also wounded. Neither suffered life-threatening wounds.

An online manifesto attributed to the gunman, John Earnest, praised the perpetrator of the shooting attack at the Tree of Life synagogue in Pittsburgh. The Pittsburgh attack took place exactly six months to the day before Saturday’s shooting.

In the manifesto attributed to Earnest, the suspect also claimed responsibility for a recent arson at a local mosque.