WHITE PLAINS, N.Y. (AP) — A woman convicted of killing her 5-year-old son by poisoning him with salt got a break on her murder sentence Wednesday because, a judge said, she suffers from a mental illness she has refused to acknowledge.

Lacey Spears, 27, of Scottsville, Kentucky, was sentenced to 20 years to life in prison for the 2014 death of Garnett-Paul Spears at a suburban New York hospital. Prosecutors said the mother force-fed high concentrations of sodium through the boy’s stomach tube because she craved the attention his illness brought to her, especially through her heavy posting on social media.

Spears displayed no emotion at the moment of sentencing.

Acting state Supreme Court Justice Robert Neary said Spears’ crime was “unfathomable in its cruelty” and brought her son “five years of torment and pain.” But he said he was not imposing the maximum 25 years to life because “one does not have to be a psychiatrist to realize you suffer from Munchausen by proxy.”

Munchausen by proxy is a disorder in which, in some cases, caretakers purposely but secretly harm children and then enjoy the attention and sympathy they receive.

Spears’ attorneys had refused to raise the disorder as a defense, and both sides agreed not to mention it at trial. After the sentencing, defense lawyer Stephen Riebling said it was odd for the judge to bring it up because Spears “hasn’t been diagnosed with any mental illness.”

Spears did not testify at her trial.

The defense, which filed an appeal Wednesday of Spears’ conviction, had asked the judge for an even lighter sentence, the minimum 15 years to life. Defense lawyer David Sachs said Spears was “a hard-working single mother who gave her son unconditional love.”

But prosecutor Doreen Lloyd, arguing for the maximum sentence, told the judge that Spears’ actions “were inhuman, they were despicable and they were evil.”

Lloyd said Spears used the boy’s feeding tube “as a weapon to kill him.”

“Garnett Spears should be in school today, and he’s not because his mother murdered him,” she told the judge.

Spears, an Alabama native, was living with her son in Chestnut Ridge, New York, when he died. She moved to Kentucky afterward and was living there when she was arrested.