Jon David Guerrero. Image via 10News

A judge Friday ordered a mental competency hearing for a man accused of attacking mostly homeless men in San Diego neighborhoods last year, resulting in four deaths.

Jon David Guerrero, 40, is charged with four counts of murder, including a special circumstance allegation of multiple murders that could lead to the death penalty if he’s convicted.

Judge Michael Smyth suspended criminal proceedings against Guerrero and set a July 24 competency hearing after receiving word from a doctor who evaluated the defendant.

Deputy Public Defender Dan Tandon — who represents Guerrero with Deputy Public Defender Whitney Antrim — said Guerrero has suffered from severe mental illness for many years.

“Understanding his illness is the key to understanding what happened and why,” Tandon said. “That kind of knowledge takes time and compassion on both sides.”

Authorities said the first attack happened on Feb. 8, 2016. Guerrero allegedly stabbed a man, who was sleeping on a sidewalk, in the face and neck.

The victim chased the defendant, who dropped a flashlight, Deputy District Attorney Makenzie Harvey alleged. Guerrero’s DNA was found on that flashlight, according to the prosecutor.

On June 28, 2016, Guerrero allegedly attacked two men while he was riding his bike, hitting them in the back of the head.

About 8 a.m. on July 3, 2016, the burning body of Angelo De Nardo was found underneath an Interstate 5 offramp near the 2700 block of Morena Boulevard in Bay Park. Witnesses described seeing a man running across the freeway near Clairemont Drive, carrying a gas can. The 53-year-old victim had a railroad spike driven into his head and chest, the prosecutor said.

The following day, Shawn Mitchell Longley, 41, was found dead at a park on Bacon Street in Ocean Beach with a railroad spike driven into his body, and 61-year-old transient Manuel Mason was severely injured by a railroad spike near Valley View Casino Center in the Midway district, according to police.

On the morning of July 6, 2016, Dionicio Derek Vahidy, 23, was gravely injured in downtown San Diego by an assailant who fled after leaving a towel burning on top of him. Vahidy died in a hospital four days later.

Harvey said Guerrero is also charged in the death of 83-year-old Molly Simons on July 13, 2016, in North Park. The victim was not homeless and lived with her husband, police said.

The prosecutor said Simons was walking to the YMCA, where she volunteered several times a week, when Guerrero allegedly rode by on a bicycle and struck her in the back of the head, causing her death.

Another attack happened shortly after 4:30 a.m. July 15, 2016, when two San Diego Harbor Police officers in a squad car in the 1800 block of C Street heard someone underneath Interstate 5 in the East Village yelling for help, police said.

The officers pulled over and found a 55-year-old homeless man suffering from “significant trauma” to his upper body.

Guerrero was arrested that day on his bicycle. The defendant had a backpack containing a large mallet with apparent blood stains along with three railroad spikes, according to the prosecutor.

—City News Service