A 64-year-old man was charged Wednesday with killing his three housemates and trying to kill two others after he allegedly set their Temple City home on fire over the weekend.

The Los Angeles County District Attorney’s Office filed three counts of murder and two counts of attempted murder against Xuanhan Zhang.

He was also charged with the allegations of multiple murders, of lying in wait and committing arson, court records show.

Zhang faces a possible maximum sentence of life in prison without parole if convicted, said Venusse Dunn, a spokeswoman for the DA’s Office.

The medical examiner’s office hasn’t identified the two men and one woman found dead by firefighters after putting out the house fire in the 6000 block of Sultana Avenue on Sunday afternoon. A sheriff’s investigator described them as being in their 60s.

A 64-year-old man and a 68-year-old man who also live in the house were critically injured in the fire.

Zhang wasn’t at the house when firefighters and deputies arrived. He later showed up and approached a deputy.

He allegedly admitted to investigators that he set the fire, Lt. Hugo Reynaga said. There had been a dispute between Zhang and one of the victims, he said.

Zhang remains in custody at the Inmate Reception Center in Los Angeles.