The High Court has ordered the release from Mountjoy Prison of an 18-year-old teenager with a history of suicide attempts and self harm.
Mr Justice Barry White made the order after being told by lawyers for the HSE that they had found accommodation for her and put in place a package of social services for the teenager.
The teenager was refused bail and remanded in custody in Mountjoy by a district court judge last week, because he was concerned she would harm herself.
She had been charged with assaulting a care worker and breaching the peace.
Her lawyers said detaining her for her own protection was unconstitutional and the Women's prison was not an appropriate place for an 18-year-old with psychiatric needs.
Lawyers for the HSE told the court that they did not have the power to detain the teenager as she turned 18 in June.
But Senior Counsel Felix McEnroy said they now had a ‘wraparound’ package of services in place for her, her solicitor had indicated she would co operate and social workers would meet her at her new accommodation tonight before working out elements of the services she needed with her in the morning.
He said the HSE was anxious that a psychiatric assessment be carried out on the teenager and after that there would be arrangements for another placement.
Mr Justice White said he had no doubt the district court judge acted out of the best of motives and in the best interest of the teenager.
He said he was not going to suggest that the district judge was so Machiavellian as to contemplate that the case would end up before the high court and the HSE would take the steps that it was now taking.
The teenager was present in court for this evening's hearing.