"It's not a case of trying to punish this man ... it's trying to prevent him later being in the judicial system in a very bad way. It appears he's on a very bad track at the moment," Ms Kelly said.
Judge Tony Walsh said the boy required at least two years of help and said there were also significant concerns for his mental health.
He said the court's primary concern was on getting the boy the best support and assistance possible.
"There is a proposition about him being admitted to Te Poutama, enquiries are being made to ascertain whether [he] will be accepted on the Te Poutama programme."
Judge Walsh remanded the boy on bail, with a condition not to have unsupervised contact with any child under 16.
All information which could lead to the boy's identification is suppressed.