A mental evaluation has been ordered for a man charged with brutal attacks that killed three homeless men in San Diego and badly injured two others.

KFMB-TV says (http://bit.ly/2awdHnm ) the competency exam for Jon Guerrero was ordered Tuesday after his public defender said the 39-year-old was severely mentally ill and might not understand the charges against him.

Guerrero has been diagnosed with schizophrenia. He has a history of arrests and once was sent to a state mental hospital.

He's charged with murder and attempted murder in a series of attacks this month on sleeping homeless men. The men were set afire or had railroad spikes driven into their bodies.

Guerrero could face life in prison if convicted.