(a) A child taken into custody shall not be detained or placed in shelter care prior to the hearing on the petition unless there is probable cause to believe that the child:
(1) Has committed the delinquent or unruly act with which the child is charged; or
(2) Is a neglected, dependent or abused child, and in either case the child's detention or shelter care is required because the child is subject to an immediate threat to the child's health or safety to the extent that delay for a hearing would be likely to result in severe or irreparable harm, or the child may abscond or be removed from the jurisdiction of the court, and in either case, there is no less drastic alternative to removal of the child from the custody of the child's parent, guardian, legal custodian or the person who physically possesses or controls the child available that would reasonably and adequately protect the child's health or safety or prevent the child's removal from the jurisdiction of the court pending a hearing.
(b) Children alleged to be unruly shall not be detained for more than twenty-four (24) hours, excluding nonjudicial days unless there has been a detention hearing and a judicial determination that there is probable cause to believe the child has violated a valid court order, and in no event shall such a child be detained for more than seventy-two (72) hours exclusive of nonjudicial days prior to an adjudicatory hearing. Nothing herein prohibits the court from ordering the placement of children in shelter care where appropriate, and such placement shall not be considered detention within the meaning of this section.
(c) A child shall not be detained in any secure facility or secure portion of any facility unless:
(1) There is probable cause to believe the child has committed a delinquent offense constituting:
(A) A crime against a person resulting in the serious injury or death of the victim or involving the likelihood of serious injury or death to such victim; or
(B) The unlawful possession of a handgun or carrying of a weapon, as prohibited by title 39, chapter 17, part 13;
(2) There is probable cause to believe the child has committed any other delinquent offense involving the likelihood of serious physical injury or death, or an offense constituting a felony, violation of probation or violation of aftercare, and the child:
(A) Is currently on probation;
(B) Is currently awaiting court action on a previous alleged delinquent offense;
(C) Is alleged to be an escapee or absconder from a juvenile facility, institution or other court-ordered placement; or
(D) Has, within the previous twelve (12) months, willfully failed to appear at any juvenile court hearing, engaged in violent conduct resulting in serious injury to another person or involving the likelihood of serious injury or death, or been adjudicated delinquent by virtue of an offense constituting a felony if committed by an adult;
(3) There is probable cause to believe the child has committed a delinquent offense, and special circumstances in accordance with the provisions of subsection (a) indicate the child should be detained; however, in any such case, the judge shall, within twenty-four (24) hours of the actual detention, excluding nonjudicial days, issue a written order on a form prescribed by the Tennessee council of juvenile and family court judges setting forth the specific reasons necessitating such detention. Nothing in this subdivision (c)(3) shall be construed as requiring a hearing or formal finding of fact, except as otherwise required by § 37-1-117;
(4) The child is alleged to be an escapee from a secure juvenile facility or institution;
(5) The child is wanted in another jurisdiction for an offense that, if committed by an adult, would be a felony in that jurisdiction;
(6) There is probable cause to believe the child is an unruly child who has violated a valid court order or who is a runaway from another jurisdiction. Any detention of such a child shall be in compliance with subsection (b);
(7) In addition to any of the conditions listed in subdivisions (c)(1)-(6), there is no less restrictive alternative that will reduce the risk of flight or of serious physical harm to the child or to others, including placement of the child with a parent, guardian, legal custodian or relative; use of any of the alternatives listed in § 37-1-116(g); or the setting of bail; and
(8) For the purposes of this subsection (c), “serious physical injury” includes conduct that would constitute the offenses of aggravated rape, rape and aggravated sexual battery.