Experts said that boys and young men with serious drug, alcohol and mental health problems were being left untreated in overcrowded and understaffed prisons.
This was highlighted yesterday when a judge refused to return a mentally disabled prisoner to a young offender institution because of concerns about his welfare.
The judge, Nadine Radford, summoned the Health minister, Rosie Winterton, to court to explain why no NHS bed could be found for Henry Nichol-Sey, despite the fact that he has a mental age of six and has already tried to kill himself six times while on remand at Feltham young offender institution in Middlesex.
The judge said: "It may be that the whole system is crumbling around our ears, but we can't tinker with people's liberty and safety. This case is the biggest that is going on in court right now. It is not murder, drugs or rape, but the life of a young man caught in the legal system is being passed around several authorities."
Nichol-Sey, of Highbury, north London, was born with a mental disability and had been placed on remand for robbery and handling stolen goods after stealing a man's jacket in April.
At a custody hearing on Tuesday, Snaresbrook Crown Court heard that as no hospital bed could be found for him, he would have to return to Feltham.
Judge Radford refused to remand Nichol-Sey and instead placed him under "virtual house arrest" with his grandmother.
Mrs Winterton was forced to leave a cabinet meeting to attend another hearing yesterday after arguments between the NHS, social services and the prison service over who had responsibility for Nichol-Sey.
The minister did not take the stand, but by then a place in a secure unit had been found and Nichol-Sey is expected to be admitted tomorrow.
The judge added: "I can't and I won't send him back to Feltham where he won't get the special treatment he needs."
Last year, 14-year-old Adam Rickwood became the youngest person to kill himself in custody, adding to the death toll of 94 other prisoners who committed suicide in 2004. More than 50 inmates have committed suicide so far this year.
Dr Seena Fazel, from Oxford University's department of psychiatry, has studied suicide rates among boys and men in English and Welsh prisons since 1978 and compared them with those of the general population.
She found that male inmates were five times more likely to kill themselves than those not behind bars.
The biggest difference was found among the 15- to 17-year-old age group, where the suicide for those in custody was 18 times higher than for the same age group in the general population.Reuse content