Child and Family Agency (CFA) Tusla has secured High Court orders to place a 15-year-old girl being pimped by her girlfriend for money and drugs in a secure unit for troubled teens.
The CFA sought the orders over concerns for the girl's life and welfare following several incidents in recent weeks.
Concerns include that the girl, who has a history of absconding and is deemed extremely vulnerable, has been sexually assaulted and abused on numerous occasions.
She was pimped out to several men by her older girlfriend for "€20 and drugs" including crack cocaine and heroin, the CFA claimed.
The girl, who cannot be identified, has been taking illegal drugs and alcohol before being exploited.
One of several men who had unprotected sex with her is a male prostitute with HIV.
While the girl has not developed the virus, she has not been taking prescribed medication.
There is also a risk that she may become pregnant, as the only contraceptive she is known to have used on occasions is the morning-after pill.
The girl, who was in several placements, had most recently been staying with her father, who the court heard has been trying to help her.
He had removed handles from doors and latches from windows to stop her fleeing.
Mr Justice Alexander Owens granted the CFA various interim orders, including allowing it to detain the girl at its facility for troubled teens in Ballydowd, Dublin.
He also appointed a social worker to act as the teen's independent guardian.
David Leahy, for the CFA, said that in his eight years of making applications to have young persons placed in secure care, this case was the most "stark".
There were serious concerns for the girl's physical health and mental well-being.
One of the men believed to have sexually assaulted her is her girlfriend's brother, the court heard.
The teen had been found at various locations after she absconded from where she was supposed to be staying, including apartments with men believed to have been using her for sex.
Counsel said gardai were investigating certain matters, including the girl's claims about being abused.
There is also a probe into the possibility that she may have participated in the making of child pornography.
There were serious concerns that the girl might be suicidal, and that she had been involved in "a suicide pact".
Counsel said the reports are that the girl is "quite bright", but had not been in school for some time after claiming to have been bullied.