If it appears to the court in a criminal proceeding, except for an offense transferred under section 27-20.4-20, that the defendant is a child subject to the jurisdiction of the juvenile court, the court immediately shall transfer the case to the juvenile court together with a copy of the accusatory pleading and other papers, documents, and transcripts of testimony relating to the case. The court shall order that the defendant be taken immediately to the juvenile court or to a place of detention designated by the juvenile court, or release the defendant to the custody of the defendant's parent, guardian, custodian, or other person legally responsible for the defendant, to be brought before the juvenile court at a time designated by that court. The accusatory pleading may serve in lieu of a petition in the juvenile court unless that court directs the filing of a petition.
N.D.C.C. § 27-20.2-07