By Cheri Mossburg, CNN
(CNN) -- John T. Earnest will spend the rest of his life in prison without the possibility of parole after pleading guilty to murder and attempted murder in the deadly 2019 shooting at a Southern California synagogue, as part of a plea agreement that will spare him from the death penalty.
Armed with and AR-15 style rifle, Earnest, 19 at the time, killed 60-year-old Lori Gilbert Kaye, who was there to honor her late mother, and injured three others, including the rabbi and an 8-year-old girl, as they worshiped inside a synagogue in the San Diego suburb of Poway. They were among more than four dozen people inside the synagogue at the time.
"Earnest admitted that he committed those crimes because of his bias and hatred of Jews," the San Diego County District Attorney's Office said in a news release on Tuesday. Earnest also admitted to setting fire to a mosque prior to the synagogue shooting, "for the purpose of terrorizing Muslim worshippers," the release added.
San Diego Superior Court Judge Peter Deddeh accepted Earnest's pleas Tuesday, and a sentencing hearing has been set for September 30.
In a statement, the district attorney's office said they hope life in prison for Earnest is "an appropriate resolution to this violent hate crime and we hope it brings a measure of justice and closure to the victims, their families, friends and the wider community. "
The decision to accept his plea, the office said, came after they consulted with the shooting victims' families.
Earnest still faces more than a hundred federal charges and hate crime charges -- including 54 counts of obstruction of free exercise of religious beliefs resulting in death and bodily injury and involving the attempt to kill -- in connection to the shooting.
That's one count for every person who was inside the synagogue, US Attorney for the Southern District of California Robert Brewer previously said. As part of that case, prosecutors referenced an open-letter posted online shortly before the shooting that bore Earnest's name.
CNN has previously reported the letter was filled with anti-Semitic and White nationalist sentiments, and the author talked about planning the attack in Poway, citing as inspiration the gunman in the 2018 deadly shooting at the Tree of Life Synagogue in Pittsburgh -- and the shooter who killed congregants at two mosques in Christchurch, New Zealand.