A California woman who was convicted twice of drowning her infant daughter in a bathtub was legally insane at the time of the murder, a jury said, sparing the mother prison time.

Lucero Carrera, 33, was determined to be not sane when she killed her 2-month-old daughter, Kimberly, in June 2012 while living with her mom and the child in Santa Ana, the OC Register reported. Carrera, who has a history of mental illness, will not spend time in prison for the murder.

Carrera drowned her daughter in a bathtub while her mother was out of the house. Prior to the killing, Carrera had stopped taking her medication because she was worried the drowsy side effect was preventing her from caring for her daughter, a courtroom testimony stated.

In 2015, a jury determined Carrera was sane at the time of the murder and found her guilty of the killing. She was sentenced to 25 years in prison, but was it was overturned on appeal.

Although a second jury found Carrera guilty of murder earlier this year, a judge declared a mistrial because jurors could not agree if the 33-year-old was sane when she killed her daughter.

A third jury was selected to only focus on the trial’s sanity phase.

Carrera is expected to appear back in court Dec. 19.