A 30-year-old San Francisco man decapitated his grandmother inside her home in a senior living facility in the city’s South of Market neighborhood, sources said Thursday.

Andrew Luke was arrested at the scene Wednesday after allegedly killing 82-year-old Chii-Chyu Horng inside her residence at 801 Howard St., officials said.

Luke was charged on Thursday with murder and elder abuse.

Several sources with knowledge of the investigation said Luke had cut off Horng’s head. A spokesman for the San Francisco Police Department would not confirm the details of the slaying or name the suspect, only saying that he “is a family member of the victim.”

Police made the gruesome discovery after responding to a welfare check around 12:25 a.m. Wednesday.

Luke was taken to a hospital for a medical evaluation. A date for his arraignment has not been set.

In an interview with The Chronicle on Thursday, Luke’s ex-stepmother, Eva Fok, said Horng raised Luke after his mother died of lupus when he was a child.

Luke had been living with Horng when he allegedly killed her, Fok said.

Fok said she did not know the details of what happened, but she said Luke suffered from mental illness and was prone to violence. She said he could be set off by things as simple as being outside, hearing background noises or laughter.

“He really loved his grandmother, oh my God,” Fok said Thursday. “I’m sure he would not do anything to his family. He loves his family.”

Gwendolyn Wu is a San Francisco Chronicle staff writer. Email: gwendolyn.wu@sfchronicle.com Twitter: @gwendolynawu