While the woman was convicted, she was found not to be criminally liable due to a diminished mental state.
Authorities say the woman is suffering from a chronic mental disorder. She will serve an undefined period in detention, pursuant to Swiss mental health law.
The boy was murdered in March, 2019, after he was approached by the woman while walking home from school.
The woman stabbed the boy in the neck with a kitchen knife. The police allege that she waited to ensure that the wounds would be fatal.
He was assisted by his teacher who was cycling past at the time and another passerby, but died after being transferred to the Basel Children’s Hospital.
The woman handed herself in one hour later after telling friends what had happened via text message.
The president of the court who sentenced the woman said she had murdered the boy “like you kill a lamb”.