The 19-year-old man accused of opening fire inside a Southern California synagogue over the weekend was ordered held without bail Tuesday as a judge labeled him "an obvious and extraordinary risk to public safety."

John T. Earnest pleaded not guilty to one count of murder with a special circumstance of a hate crime and three counts of attempted murder in Saturday's shooting at the Chabad of Poway synagogue north of San Diego, which killed 60-year-old congregant Lori Kaye and injured three other people, including the synagogue's rabbi. Earnest also was charged with one count of arson in connection with a fire set last month at a mosque in nearby Escondido.

Earnest showed no emotion during the brief hearing at the Hall of Justice in downtown San Diego. He spoke only once, responding "yes" to a question put to him by Judge Joseph P. Brannigan, and occasionally glanced at public defender John O'Connell for guidance.

Prosecutor Leonard Trinh said Earnest burst into the synagogue with a semi-automatic rifle shortly after the start of services marking the last day of Passover while wearing a helmet and a tactical vest that held five 10-round magazines. According to the prosecutors' account, Earnest shot Kaye twice in the synagogue's foyer, then shot Rabbi Yisroel Goldstein, who lost his index finger in the shooting.

Earnest then turned to a room full of children and other adults, investigators said. Congregant Almog Peretz tried to protect his niece, 8-year-old Noya Dahan, and other children and received shrapnel wounds, as did Noya.

Trinh said Earnest fired eight to 10 rounds. Then, either the rifle jammed or he wasn't able to release the magazine to reload, investigators said. The suspect then ran off, avoiding an Army combat veteran and an off-duty Border Patrol agent who chased after him. Earnest called 911 to report the shooting and surrendered a short time later.

CLICK HERE TO GET THE FOX NEWS APP

Trinh noted that the entire shooting was recorded by the synagogue's surveillance cameras and quoted briefly from an online manifesto which Earnest allegedly wrote. San Diego County District Attorney Summer Stephan told reporters after the hearing that Earnest had bought the rifle legally but declined to provide further details, citing the ongoing investigation.

The district attorney said she would decide whether to seek the death penalty against Earnest at a later date. The suspect could also face life without parole if convicted.

Earnest's next court appearance was scheduled for May 30.

The Associated Press contributed to this report.