If any child under the age of eighteen years is arrested, with or without a warrant, for a violation of any law or municipal ordinance for which the child is not subject to proceedings as a child in need of supervision as defined in § 26-8B-2 or a delinquent child as defined in 26-8C-2 or for a violation of subdivision 34-46-2(2), the child shall be brought before the judge of a court having jurisdiction over the offense and proceedings shall be conducted as though the child were eighteen years of age or older. A child under the age of eighteen years, subject to proceedings pursuant to this section and accused of a Class 2 misdemeanor, may be held in or sentenced to a detention or temporary care facility for up to seven days if sight and sound separated from adult prisoners. No child may be held in or sentenced to a detention facility for a violation of subdivision 34-46-2(2). A child under the age of eighteen years, subject to proceedings pursuant to this section and accused of a Class 1 misdemeanor, may be held in or sentenced to a detention or temporary care facility for up to thirty days if sight and sound separated from adult prisoners. Source: SDC 1939, § 43.0318 as added by SL 1961, ch 214 , § 1; SL 1973, ch 169 , § 2; SL 1991, ch 217 , § 173; SL 1996, ch 179 , § 3; SL 1997, ch 158 , § 5; SL 1998, ch 215 , § 4; SL 2003, ch 149 , § 8.