Too many children in England are being admitted to mental health hospitals unnecessarily, according to a report.
Research for the Children's Commissioner for England found children were often unable to get appropriate support at school and in the community.
This was contributing to children ending up in institutions, sometimes for months or years, the report found.
Children with learning disabilities or autism were being particularly let down by the system, it added.
Children's Commissioner Anne Longfield's report says successive governments have tried to tackle the problem, but the number of children in mental health hospitals remains "unacceptably high".
Research shows a clear need to "focus on children's journeys before they are admitted into inpatient care", the report says, but often this is not happening.
"Children, families and staff working in this area spoke again and again about how the failure to provide appropriate support to children when they are in school and living in the community, and particularly when they reach a crisis point, has contributed to inappropriate hospital admissions and delayed discharges," it says.
The review says there were 250 children identified as having a learning disability or autism in mental health hospitals in England in February 2019, compared with 110 in March 2015.
According to the report, NHS England said the figure of 110 was due to under-identification of these children in the past.
But even using adjusted figures from NHS England, the number has still not come down in the last four years, the report says.
'Frightening and overwhelming'
It says it is "particularly concerning" that these findings come after NHS England's Transforming Care programme, which sought to improve the quality of care for people with a learning disability or autism.
Ms Longfield said: "They are some of the most vulnerable children of all, with very complex needs, growing up in institutions usually far away from their family home.
"For many of them this is a frightening and overwhelming experience. For many of their families it is a nightmare."
Ms Longfield said she had spoken to parents whose children had been "locked away in a series of rooms for months".
"Others have to listen as they are told by institutions that their child has had to be restrained or forcibly injected with sedatives," she said.
"They feel powerless and, frankly, at their wits' end as to what to do."
Ms Longfield is calling for a national strategy to "address the values and culture of the wider system across the NHS, education and local government so that a failure to provide earlier help is unacceptable, and admission to hospital or a residential special school is no longer seen as almost inevitable for some children".
A spokesman for the National Society for the Prevention of Cruelty to Children (NSPCC) said some of the most vulnerable children were being "horribly failed".
He said: "No child should be left to languish alone and it's important that the government takes urgent action to provide high quality, community-based care that can prevent the need for children to be placed in secure hospitals."
Tim Nicholls, head of policy at the National Autistic Society, said autistic children and adults were "being failed by a broken system".
Wherever possible, autistic people should get the mental health support they need in their own community, he added.
The government said it was determined to reduce the number of people with autism or learning disabilities who are in mental health hospitals.
A spokeswoman said: "The NHS is committed to reducing numbers of people with a learning disability and autistic people who are inpatients in mental health hospitals by 35% by the end of March 2020, and through the Long Term Plan we will reduce numbers even further by investing in specialist services and community crisis care and giving local areas greater control of their budgets to reduce avoidable admissions and enable shorter lengths of stay.
"The CQC [Care Quality Commission] is also undertaking an in-depth review into the use of seclusion, segregation and restraint - which should only be used as a last resort - in order to improve standards across the system."