MARTINEZ -- A judge has ruled a 58-year-old woman is not guilty by reason of insanity for stabbing her 81-year-old neighbor to death in 2012, according to the Contra Costa District Attorney's Office.

Contra Costa Judge Terri Mockler issued the ruling at a hearing on Friday after Diane Sydenham pleaded guilty to second-degree murder. Instead of prison time, Sydenham will spend the remainder of her life in a state mental hospital.

Authorities said Sydenham stabbed retired psychologist James Durkin 28 times in the chest with a kitchen knife in August 2012. About three days after the stabbing, a neighbor found Durkin inside his Kensington home with the knife still in his chest.

A police detective later testified at a preliminary hearing that Sydenham's blood was found inside Durkin's home on Coventry Road, and Durkin's blood was found inside Sydenham's home in nearby Albany.