A family court judge has warned of a "terrible national shortage" of places in secure units for dangerous youngsters.
Judge Sarah Singleton said there was a "gross shortage of resource" which created a "lack of protection for the public".
The judge made her comments in a written analysis of a case, involving a 15-year-old boy who had a "terrifying" history of violence, following a private family court hearing in Lancaster.
She said it was plain that the teenager - who had a "terrifying history of behaving both violently and in an assaultive sexual manner to women" - ought to be kept in secure conditions while experts addressed the "issues which beset him".
And she said the youngster, who had convictions for violence and indecent assault, should have been placed in secure accommodation after being released from a custodial sentence - made up of a detention and training order.
But she said Lancashire County Council had been unable to find him a place in a secure unit and he had to be placed in a children's home.
"The facts ... amount to a terrible national shortage of secure placements for children and young people who are a danger to themselves and others," said Judge Singleton.
"This case demonstrates a gross shortage of resource. The shortage necessarily creates a lack of protection for the public and for the dangerous young person/child."
The judge said it was "only right" that the circumstances of the case were made public.
She said there were 17 secure units in England and Wales - and 1,200 places for youngsters convicted of a crime and given a custodial sentence.
But she said there were "only 60" allocated "welfare places" - for youngsters who were classified as dangerous but were not serving a sentence.
Judge Singleton said council staff had made "exhaustive efforts" to "secure secure accommodation" for the teenager - and had held discussions with the Department for Education.
She said the council had also had also seconded three extra staff to the children's home where the teenager had been placed to "look after" him.
The youngster was not identified by the judge.
She said he had been "accommodated" by the council three years ago and was the subject of a care order. She said he had lived "chaotic lifestyle" at home and is childhood had been marred. She said his mother had abused drugs and alcohol and there had been violence between his mother and her partners.