A 15-year-old boy, who is a sex abuse victim and believed to be linked to prostitution, has been moved out of Dublin for his own safety.
The teenager had been held in custody since the start of the year amid fears for his safety.
The Children's Court has heard that he had associated with prostitutes, has been in debt to drug dealers, sold drugs at school and known to carry a knife.
It has also been revealed that before he came to the attention of the court he had an income of €300 a week, which is currently under Garda investigation.
An Breitheamh Aingeal Ní Chondúin was also told yesterday while the boy has been in custody "it has been discovered that a third party has been lodging money into his bank account".
Defence solicitor Michelle Finan said that after learning about the instalments into the account, gardaí have been contacted and are to investigate the matter.
The issue of the boy being in receipt of monies from a certain individual has been raised in the case several times.
It has also been stressed to the young boy that he had to cease the activities from which he had been earning money. The court has also been told that these activities were putting him at huge risk.
Also the teenager had been the subject of an investigation in which he was viewed as the victim, however he did not co-operate with Garda inquiries.
There are fears the boy would be in danger if he returned to his locality and he needs to be moved to keep him out of danger.
Yesterday the judge agreed to grant bail under strict terms and adjourned the case until April.
The boy is to reside with a relative outside of Dublin, have no contact with any of the persons he had been associating with and to sign on daily at a Garda station.
Barry O'Donnell, counsel for the Health Service Executive (HSE), told the court that while the HSE could not be compelled to attend the court case, social workers would make a referral to have the boy assessed in a special centre that helps victims of sexual abuse.
The teenager had been originally brought before the court last year over assaulting a garda.
He had been caught outdoors at 3.30 in the morning while he was going to Leeson Street in search of a prostitute, the court had heard earlier.
Det Garda Richard Hampson had told the court that when he asked the young boy where he was going, he replied that he was "going to Leeson Street to seek a prostitute".
It was then decided that the teenager should be taken back to his home for his own safety.
At that stage the boy was not under arrest, but as the Garda car neared his home he became extremely aggressive and started to struggle.
His violent behaviour continued and he kicked the detective repeatedly, leaving him with bruising on his legs.
The boy has no previous convictions.
His mother has become increasingly worried over his problems and is anxious for him to receive help.
Psychologists have also told the court that the boy needs psychotherapy to return to education and specialised help.