Putting a child in a cell and placing them in danger should not be acceptable, says the Children's Commissioner.
A 13-year-old boy was held in police cells overnight in Auckland on Thursday before being transferred to court where hours later his charge of endangering transport was withdrawn.
RNZ understands the boy was held in court cells with violent offenders until about midday Friday - even after the charge was withdrawn.
Judge Andrew Becroft said, generally, holding children in cells should end.
"It's dangerous for children, it's dangerous to their well-being, it's dangerous psychologically and we know there are real risks of self-harm if not suicide. That should be the fear that all of us have."
Under the Oranga Tamariki Act, police can only hold a 12 or 13-year-old if they are charged with an offence that carries a maximum penalty of at least 14 years. The boy had been charged with endangering transport - a charge that carried a maximum term of 14 years in prison.
Judge Becroft said the number of 18-year-olds held in cells had "ebbed and flowed" over the past 20 years. But he said this year it had been "quite significant" with two to four young people held each week.
"It's something that we need to take seriously. We can do much better in a country like New Zealand, and we should," Judge Becroft said.
"In extreme situations it may be necessary before court but in general the practice should be considered unacceptable and we should be committed to better alternatives with community based options that provide the necessary security and oversight."
He said the concerns were also raised when New Zealand was last examined by the United Nations in Geneva last year.
"If it was my son or daughter [in a cell] I'd almost be there every hour of every day to check that they're okay, such are the risks."