If a child has been taken into custody under this article and not released to a parent or guardian, the juvenile court shall hold a hearing (which shall be referred to as a "detention hearing") to determine whether the child shall be further detained. This hearing shall be held as soon as possible, but not later than the expiration of the next judicial day after a petition to declare the child a dependent child has been filed. If the hearing is not held within the period prescribed by this section, the child shall be released from custody. In the case of an Indian child, the hearing pursuant to Section 319 shall be considered an emergency removal under subdivision (g) of Section 305.5 of this code and Section 1922 of the federal Indian Child Welfare Act of 1978 (25 U.S.C. Sec. 1901 et seq.).
Ca. Welf. and Inst. Code § 315