Prosecutors present chilling scene footage from deadly California synagogue shooting Earnest also faces arson charges in connection with a fire at a mosque.

Prosecutors presented disturbing surveillance video in a court hearing Thursday related to the deadly shooting at a California synagogue in April. The video shows the gunman storming the house of worship and targeting congregants with an assault riffle, killing a woman and injuring three others.

The video was presented as evidence in a preliminary hearing for 20-year-old John Earnest, who is charged with murder and attempted murder for allegedly killing Chabad of Poway synagogue member Lori Gilbert-Kaye, 60, and shooting other worshipers, including an 8-year-old girl.

Earnest has been charged with a hate crime, which could make him eligible for the death penalty if convicted. The multi-day hearing will ultimately decide if Earnest will face trial or not.

Surveillance cameras from inside and outside of the synagogue near San Diego captured the entire scene on video, starting from the moment the gunman drove up to the church and ending with congregants chasing him away.

The shooting took place on April 27, the last day of Passover.

In the video, the shooter began to open fire even before he opened the synagogue's doors. Gilbert-Kaye saw him immediately and tried to flee. She barely managed to turn before the bullets ripped into her.

He continued firing, hitting Rabbi Israel Goldstein, who seemed to leap up when shot and sprint into the sanctuary. The gunman's weapon appeared to jam and he struggled with it for a bit before a worshiper, Iraq combat veteran Oscar Stewart, chased him outside.

Stewart testified in court Thursday, revealing that he screamed at the shooter and caused him to drop his weapon and flee. He identified Earnest as the shooter in court.

"He was firing in front of me. ... I was paying attention to the rifle," Stewart said. "I told him I was going to kill him. ... I screamed it out really loud. I kept screaming at him."

"I was trying to throw him off. I didn’t say it very politely. I yelled it and used some profanities also," he added.

Prosecutors also played audio of the suspect's 911 call in which he said he allegedly told dispatchers that he'd been involved in the shooting and was armed. He said he had weapons in his car, but wouldn't use them on authorities.

At one point he was heard on the call saying: “I’m just trying to defend my nation from the Jewish. …They’re destroying our people … we’re not going to go down without a fight.”

Earnest, a former nursing student at Cal State San Marcos, also faces federal arson charges in connection with a fire at a mosque in Escondido. He has pleaded not guilty to all charges.

ABC News' Matt Gutman and Jennifer Watts contributed to this report.