A mother who waited until her husband had popped out before drowning her four-month-old son in a baby bath was "divorced from reality" at the time.
The woman, who cannot be identified, killed the baby in her Sydney suburban home on May 20, 2021.
"In the short absence from the home of her husband, the accused took the opportunity to drown her son by holding him underwater in a baby's bath until he stopped breathing, and died," said Justice Richard Button on Thursday.
The death had caused "immense suffering" to many, the judge said, extending his condolences over the tragedy.
"I believe that, if she has not already done so, the accused when completely well will come to see the enormity of her own grossly disturbed act," he told the NSW Supreme Court.
The judge found the then 32-year-old mother of two was not criminally responsible for the "distressing and lamentable act" because of her mental state.
After a brief hearing on Monday, crown prosecutors and woman's lawyers agreed that she had a mental health defence.
Two forensic psychiatrists told the court she had perinatal major depression with psychotic features.
"At that time, the accused suffered from a mental health impairment that led her to fail to appreciate the profound and palpable wrongfulness of her act," Justice Button said.
"In more than one way, the thinking and feelings of the accused were thoroughly divorced from reality."
While the baby was born with hearing problems and was difficult to settle, this did not mean the woman's actions were rational, the judge said.
"Although the accused did appreciate that she was drowning her son, that impairment caused her not to appreciate that what she was doing was wrong in any real sense," he said.
"On the contrary, she tragically believed that she was doing something right."
The mother showed warning signs prior to the homicide, including conducting internet searches with suicidal intent and trying to harm herself in public.
While she was prescribed anti-depressants and was contacted by a suicide prevention service, she did not take advantage of either of these options.
The court found her plan was also divorced from reality, as she wanted to become incarcerated over the baby's death where she herself would be killed behind bars.
The woman will now be held at a forensic hospital and undergo mental health treatment until such time as she can be released back into the community.
"Those orders ... are designed to ensure the continuing care of the accused and, of course, the ongoing protection of the community," Justice Button said.
Lifeline 13 11 14
beyondblue 1300 22 4636