A teenager who threatened to throw a two-year-old boy out of a window should have received a custodial sentence, appeal judges have ruled.
Joshua Ingram, 18, from Grimsby, was given a suspended sentence after admitting making threats to kill, assault and criminal damage.
The offences related to an incident at his ex-girlfriend's former home.
The Court of Appeal said the original sentence was "unduly lenient" and said he must be detained for three years.
The case was referred to the Court of Appeal by the Solicitor General Robert Buckland QC.
He said: "This young man's violent temper left a defenceless child and mother fearing for their lives."
The attack on the woman and her child took place at her home in Grimsby in May 2017.
Ingram had become irritated by the toddler and lost his temper and started swearing at the boy and his mother.
She tried to take her son from the room but as she passed Ingram he hit the child's head against a wall.
Ingram then damaged property in the living room before following her upstairs where he tried to grab the child, threatening to throw him down the stairs or against a wall.
Ingram also repeatedly threatened to kill the woman and her child.
At Grimsby Crown Court in October he was sentenced to two years in a young offenders' institution, suspended for two years .
Mr Buckland said it had been too lenient.
"The original sentence failed to take proper account of the seriousness of the offence," he said.
"I am pleased the court has seen fit to impose an immediate custodial sentence and I hope it brings some comfort to the victim."