A mother who killed her son because of concerns over his “pedophillic tendencies” and his vow to take his own life did so out of her great love for him, a judge has said.

Kim Margaret Earle, 49, sobbed and shook as she was sentenced on Tuesday in the Brisbane supreme court, which heard she was of diminished responsibility when she killed her 18-year-old son, Brandon, on the Gold Coast in 2013.

Justice Roslyn Atkinson said Brandon’s interest in sadomasochism and child abuse material had reached the point where he wanted to kill himself following his arrest for offences related to child abuse images and his mother couldn’t see any way out.

“Essentially, you helped him to die out of your great love for him,” Justice Roslyn Atkinson said as she sentenced Earle. “There are not many cases where the killing is committed out of love.”

After already spending just over three years in custody, Atkinson said Earle had suffered enough and should be released in three months.

The court heard Earle had planned to die alongside her son but had woken up from an attempted overdose and made several other unsuccessful attempts to kill herself. She now suffers from memory loss after undergoing electric shock therapy and has to be reminded of what she has done.

Asked if she had anything to say after pleading guilty, Earle spoke of her love for her son. “I loved him very much. It was a privilege to be his mum,” she said.

The court heard Earle struggled for 18 years to raise her boy, who had an undiagnosed condition and had been spending a lot of time on websites featuring child abuse images and writing sexually violent stories.

She feared he would be arrested and he vowed to stab himself to death if he was ever caught.

When police raided their home in December 2013, he clashed violently with police and Earle feared what he would do when he was released.

She took a taxi to the Gold Coast University Hospital, where she worked as a nurse, donned scrubs, and stole drugs and equipment from a controlled-medication store.

After spending the night crying, she collected her son from the watchhouse and when they got home, he tried to find a knife to carry out his plan to kill himself.

That’s when she told him she could help. Brandon wrote four pages of final words and was given a fatal overdose while lying on his bed. Earle covered his body with a sheet and placed a frangipani on top of it.

She then had her dog put down and tried to kill herself

Earle has been in custody for three years and three months, and has undergone treatment for depression and anxiety.

Atkinson ordered she be released from jail on 28 May to live with her mother and sister in NSW.

“It is time you got out of custody,” Atkinson said. “You have had more than your fair share of suffering.”

• Crisis support services can be reached 24 hours a day: Lifeline 13 11 14; Suicide Call Back Service 1300 659 467; Kids Helpline 1800 55 1800; MensLine Australia 1300 78 99 78; Beyond Blue 1300 22 4636