A mother, stepfather and a teenager have been given life sentences for murdering five-year-old Logan Mwangi and dumping his body in a river.
John Cole, 40, will serve a minimum term of 29 years in prison while Logan's mother, Angharad Williamson, 31, will serve at least 28 years.
Craig Mulligan, 14, will serve at least 15 years. All three were convicted of murdering Logan in July 2021.
His body was found in the River Ogmore, near his home in Sarn, Bridgend county.
Mrs Justice Jefford told Cardiff Crown Court that the attack on the "defenceless" schoolboy, who weighed 3st 1lb (20kg), was "nothing short of horrifying".
Watch Logan Mwangi: A Boy Betrayed on iPlayer.
Rejecting Williamson's version of events that Cole and Mulligan attacked Logan two days before his body was found and that she had run out of the house in an attempt to get help, Mrs Justice Jefford said: "That was made up after the event to protect yourself and shift the blame.
"You had an opportunity to protect your son from further injury and you did nothing.
"Whatever time the ferocious assault on Logan happened, he was for the most part of Friday injured or dying."
Police officers found Logan partially submerged in the river in Pandy Park, just 250m from his home. He was wearing his dinosaur pyjama bottoms and a Spider-Man top.
His body was dumped like "fly-tipped rubbish", the prosecution said.
During the trial, jurors had heard how Logan was treated like a prisoner in the days before his death.
On 20 July, Logan tested positive for Covid-19 and he was shut in his bedroom for 10 days with a baby gate stopping him from leaving.
Mrs Justice Jefford described this decision by the couple as "extreme" and said the treatment of him was "the culmination of treatment that had dehumanised him".
Logan's stammer is said to have worsened, becoming particularly bad around Cole, the jury was told, and he wet himself more frequently and began self-harming.
The jury were played extensive CCTV footage from nearby houses which showed Cole and Mulligan at 02:43 BST on 31 July moving Logan's body in a sports bag to the nearby river, where they dumped it.
They were caught again as they came back to the house to pick up the dinosaur pyjama top Logan had been wearing, which police found in a wooded area with a big cut in.
Talking about the cover-up, Mrs Justice Jefford said what they did was "careful and calculated and not the product of panic".
"It is impossible to imagine the terror a five-year-old would feel suffering those horrific injuries inflicted upon him by those regarded as his family with the compliance of his mother."
The concealment of Logan's body in the river, was described as "heartless", "calculated and orchestrated".
The jury also heard Mulligan had a "desire for violence" and pushed Logan down the stairs, breaking his arm. A support worker once heard him singing: "I love to punch kids in the head, it's orgasmic."
Mrs Justice Jefford told the trio they were "all responsible for Logan's death and all the anguish that has flowed from it".
"Because he was killed in his own home, it is not possible to be sure what has happened to him," she said.
She described the injuries Logan suffered as "the sort of injuries seen in abused children".
Logan, a previously "smiling, cheerful little boy", died after suffering a "brutal and sustained" attack at home, leaving him with 56 "catastrophic" injuries, including extensive bruising to the back of his head and tears in his liver and bowel.
Friends of the couple said Cole told them he did not like Logan, and others said his attitude changed after becoming obsessed with the idea that Williamson had cheated on him with Logan's father Ben Mwangi.
'I don't want to go back to sleep'
Ben Mwangi wept as his victim impact statement was read out to the court on his behalf.
In it, he recalled collapsing and hitting his head when he was told of his son's death while at work.
"I just felt like every fibre in my body had died and I couldn't stop crying."
After finding out about Williamson's arrest, he said he felt "devastated that I couldn't have been there to protect him".
Mr Mwangi said he could no longer sleep and experienced recurring nightmares.
"My dreams of Logan are so vivid, Logan comes to tell me that he is OK and to check if I'm OK.
"He runs into my arms and I hold him tight, but he then slowly disappears until he's no longer in my arms. I wake up screaming and crying.
"I find it difficult to go back to sleep, I don't want to go back to sleep because I don't want to experience these dreams because they are so painful."
The courtroom was full, including Logan's family, relatives of the three killers and members of the jury who sat through the trial.
Williamson cried throughout and held her head down throughout the sentencing. Cole showed no emotion as he was sentenced, nor did Mulligan.
Cole previously pleaded guilty to perverting the course of justice, while Williamson and Mulligan were found guilty of the same charge.
In a statement, Tondu Primary School said Logan was a "loving, sweet-natured child who was polite and articulate at all times".
"Logan was always smiling, and was described in court by his own teachers as having the kind of smile that could light up a classroom.
"He was a highly inquisitive child who enjoyed his lessons, particularly when using the outdoor classroom where he would have great fun with his friends.
"Logan loved playing with his classmates, especially games like hide-and-seek or pretending to be superheroes. His favourite character was always Spider-Man and he would display a keen and vivid imagination in his games.
"Ultimately, we remember Logan as being a bright, happy child who was caring and loving, and an absolute pleasure to teach."
Det Insp Lianne Rees of South Wales Police paid tribute to her colleagues, other emergency service workers, prosecutors and Logan's family.
Cwm Taf Morgannwg safeguarding board said a report was due to be presented to the regional safeguarding board in the autumn before being submitted to the Welsh government for final endorsement and publication.
Assistant director of NSPCC Cymru, Tracey Holdsworth, said what happened to Logan "should never be forgotten", and that a child safeguarding practice review should leave "no stone unturned".