*585This case would be almost comical if it were not so troubling. Some parents of unruly teenagers undoubtedly have fantasized at one time or another, when all else fails to get their teens out of bed and off to school, about having authorities press criminal charges. But in this case, what might be outlandish fantasy became reality.
R.M., a mouthy 17-year-old high school student with an abysmal school attendance record, was held to answer criminally for her truant ways. Standing in the parking lot of her high school campus one morning, where she had grudgingly been driven after initially refusing even to leave home, she refused to obey a deputy sheriff's order to go inside to class. She was then handcuffed, arrested and escorted to juvenile hall where she was held in custody for two days. The juvenile court sustained allegations that R.M. violated Penal Code section 148 by resisting, delaying or obstructing a peace officer in performing his or her duties. It declared her a delinquent ward of the juvenile court under Welfare and Institutions Code section 602,1 ordered her confined for 15 days to juvenile hall and thereafter placed on probation. Her previously clean criminal record was clean no more. She now appeals, challenging both the jurisdictional finding that she violated the criminal law and several terms and conditions of her probation.
We reverse. R.M. did not violate Penal Code section 148, because the arresting officer was not performing a legal duty when he ordered her to class. Since he had no legal duty to do that, R.M. could not be *575charged criminally for disobeying his order. However well-intentioned the officer no *586doubt was, and despite the difficult predicament in which school authorities were placed by R.M.'s defiance and belligerent attitude, the proper recourse was for school officials to pursue appropriate channels for seeking a declaration of wardship under section 601, subsection (b) for habitual truancy (which in fact they eventually did).2 Not resort to the criminal law.
BACKGROUND
The morning of March 10, 2016, began for R.M. like the morning of a typical teenager: she refused to get out of bed and get ready for school. Her mother tried repeatedly to cajole her, but R.M., who hated school, just ignored her mother and would not budge. This prompted her mother to call for assistance from a police officer with the City of Napa Police Department who works as a diversion officer to help parents and school officials in the local school district address severe behavioral or truancy issues.
This was not an isolated incident. For years, R.M. had had attendance problems, and at this juncture she was regularly skipping out of school. The diversion officer had long been involved with the situation, and R.M.'s mother had sought her assistance on other occasions when R.M. had refused to go to school. In fact, a truancy petition under section 601, subdivision (b) had been filed against R.M. in the past but, for reasons not in the record, had been dismissed some nine months earlier, in April 2015. And only days before, the diversion officer had recommended that the district attorney's office initiate new section 601 wardship proceedings in the face of R.M.'s persistent truancy problems.
So, once again, the diversion officer went to R.M.'s home that morning to try to help, accompanied by the Napa County deputy sheriff who was assigned to R.M.'s high school, where he was responsible for campus security and other matters including truancy.
*587When the two law enforcement officers arrived at R.M.'s home, she became hostile and defiant and, uttering profanities, initially refused to get into the car and go to school. Eventually, though, she complied and the two drove her in a patrol car to the parking lot of her high school, with R.M. insisting all the while that she wasn't going to get out of the car and wouldn't go to class.
When they arrived, they parked next to a classroom building and were met by the high school's principal. After R.M. got out of the car, her principal and the diversion officer each told R.M. to go to class. Both times she refused, insisting she didn't need to listen to them. She began walking away, *576in the direction of leaving campus, and then the deputy sheriff told her to stop and he too told her go to class. She ignored him and kept walking, then turned and insisted she didn't have to listen to him either and, again uttering profanities, insisted she was leaving. At this point, the deputy sheriff believed she was going to leave campus and so he walked up to her, grabbed her by the arm and arrested her. She did not resist.
The deputy sheriff testified that he arrested R.M. not for resisting arrest, but for delaying him in performing his other duties at the school. He also believed she was delaying him in getting her to attend school. Asked on cross-examination whether he had legal authority to arrest a student for leaving school, the deputy sheriff testified that he did: "If I'm acting as a police officer and that individual is refusing to follow my directives, yes." The high school principal also believed a student may be arrested for refusing to go to class ("There is authority to arrest for refusal to do any directive").
Upon her arrest, R.M. was booked into juvenile hall where she remained in custody for two days.
Five days after her arrest, on March 15, 2016, in separate proceedings not at issue here, a second truancy petition under section 601, subdivision (b) was filed against R.M. for failing to attend school as required during a seven-month period ending on March 7, 2016 (i.e., three days before the incident at issue here) and thereafter, on March 18, R.M. was declared a ward of the juvenile court as a truant in those separate proceedings.
A month later, on April 15, 2016, these proceedings were commenced. The Napa County District Attorney filed a section 602 wardship petition containing a single count alleging that on March 10, R.M. had resisted, obstructed and delayed a police officer in performing his duties ( Pen. Code, § 148, subd. (a)(1) ), an offense carrying a maximum confinement time of one year. The juvenile court sustained the allegations at a contested jurisdictional hearing. Thereafter, it declared R.M. a ward of the court and ordered her to *588serve 15 days in juvenile hall, followed by home probation subject to various terms and conditions, including 30 days of GPS monitoring, gang terms, and a requirement that she submit all of her electronic devices to warrantless search at any time, including all of her social media accounts and data in online cloud storage.
This appeal followed.
DISCUSSION
R.M. challenges both the juvenile court's jurisdictional findings and its imposition of the gang-related and electronics search conditions of her probation. It is unnecessary to address the probation conditions, because we agree with her primary contention: that the juvenile court improperly sustained the petition and declared her a section 602 ward.
Penal Code section 148 makes it a misdemeanor to "willfully resist [ ], delay[ ], or obstruct[ ] any public officer, [or] peace officer ... in the discharge or attempt to discharge any duty of his or her office or employment." ( Pen. Code, § 148, subd. (a)(1).) " 'The legal elements of a violation of section 148, subdivision (a) are as follows: (1) the defendant willfully resisted, delayed, or obstructed a peace officer, (2) when the officer was engaged in the performance of his or her duties, and (3) the defendant knew or reasonably should have known that the other person was a peace officer engaged in the performance of his or her duties.' " ( In re Amanda A . (2015) 242 Cal.App.4th 537, 546, 195 Cal.Rptr.3d 384.) R.M. contends there is no substantial *577evidence the deputy sheriff was performing a legal duty when he ordered her to go inside to class, and we agree.3
The Legislature has established a comprehensive scheme for dealing with truants. ( In re James D . (1987) 43 Cal.3d 903, 910, 239 Cal.Rptr. 663, 741 P.2d 161 ( James D . ); see generally Ed. Code, § 48260 et seq. ) A minor who is absent from school during school hours in violation of the state's Compulsory Education Law (Ed. Code, tit. 2, div. 4, pt. 27, ch. 2, § 48200 et seq.) is subject to arrest under section 48264 of the Education Code. ( James D ., at pp. 909-910, 239 Cal.Rptr. 663, 741 P.2d 161.) That provision states: "The attendance supervisor or his or her designee, a peace officer, a school administrator or his or her designee, or a probation officer may arrest or assume temporary custody, during school hours, of any minor subject to compulsory full-time education *589or to compulsory continuation education found away from his or her home and who is absent from school without valid excuse within the county, city, or city and county, or school district." ( Ed. Code, § 48264.) However, as our Supreme Court has made clear, "[t]he effect of an arrest under section 48264 is very different from the effect of a typical criminal arrest. The emphasis is not on punishment but on correction of truancy, i.e., to promote attendance in order that students may be educated." ( James D ., at p. 910, 239 Cal.Rptr. 663, 741 P.2d 161 ; accord, In re Miguel G . (1980) 111 Cal.App.3d 345, 349, 168 Cal.Rptr. 688 [truancy arrest "is a severely limited type of arrest and ... is for one purpose only: to place the minors in a school setting as quickly as possible"].) A minor who is detained for truancy is not taken into custody but, rather, pursuant to Education Code section 48265, must be delivered either to "the school from which the minor is absent," or to their parent, guardian or another person in charge of them, or to designated persons for counseling.4 ( James D ., at p. 910, 239 Cal.Rptr. 663, 741 P.2d 161.)
In aggravated circumstances involving habitual truants, the juvenile court may assert jurisdiction over the minor as a status offender pursuant to section 601, subdivision (b) (quoted ante , fn. 2).5 ( *578James D. , supra , 43 Cal.3d at p. 910, 239 Cal.Rptr. 663, 741 P.2d 161 ; see also Ed. Code, § 48263.) Even then, however, the Legislature has enacted sharp limitations against confining truants, because the objective of this state's truancy regime is educational not punitive. (See James D ., at p. 910, 239 Cal.Rptr. 663, 741 P.2d 161 ; accord, L.A. v. Superior Court (2012) 209 Cal.App.4th 976, 984, 147 Cal.Rptr.3d 431 ["The goal of section 601 and related provisions of the Education Code is not to punish truants, but to promote their attendance in school"].) Section 601, subdivision (b) expressly declares the Legislature's *590intent "that a minor who is described in this subdivision, adjudged a ward of the court pursuant solely to this subdivision, or found in contempt of court for failure to comply with a court order pursuant to this subdivision, shall not be held in a secure facility and shall not be removed from the custody of the parent or guardian except for the purposes of school attendance ." (§ 601, subd. (b), italics added; see also § 207, subd. (b) [stating exceptions of limited durations for purposes of determining the existence of outstanding warrants, or locating parents or guardians].) Even a minor adjudged a section 601 ward of the juvenile court who disobeys a court order to attend school may not be securely incarcerated, except as a last resort: only in the most severe cases involving "egregious" violations and where no other contempt sanction will suffice. ( Michael G ., supra , 44 Cal.3d at pp. 297-298, 243 Cal.Rptr. 224, 747 P.2d 1152 ; see, e.g., L.A. v. Superior Court , supra , 209 Cal.App.4th 976, 147 Cal.Rptr.3d 431.) And even then, the contemptuous minor must be segregated from, and have no contact with, the delinquent juvenile population. (See Michael G. , at p. 297, 243 Cal.Rptr. 224, 747 P.2d 1152 ; § 207, subds. (c), (d).)
R.M. asks us to decide that what took place in this case was an improper end-run around this carefully crafted legislative scheme and that the Legislature did not intend for Penal Code section 148 to be used "as a means to incarcerate minors refusing to attend school," and there are significant reasons to doubt that it did. For example, juvenile courts may not use criminal contempt charges to elevate what would be a section 601 status offense into a section 602 delinquency offense. (See In re Ronald S. (1977) 69 Cal.App.3d 866, 873-874, 138 Cal.Rptr. 387 [violating juvenile court order by running away from crisis center], discussed with approval in Michael G. , supra , 44 Cal.3d at pp. 292-293, 243 Cal.Rptr. 224, 747 P.2d 1152 ; see also In re Mary D. (1979) 95 Cal.App.3d 34, 156 Cal.Rptr. 829 ; In re Ricardo A . (1995) 32 Cal.App.4th 1190, 1198-1199, 38 Cal.Rptr.2d 586 ; cf. In re Francisco S. (2000) 85 Cal.App.4th 946, 959, 102 Cal.Rptr.2d 514.) Otherwise, juvenile courts could simply "do[ ] by indirection that which cannot be done directly." ( In re Ronald S ., at p. 874, 138 Cal.Rptr. 387.) We doubt the Legislature any more intended to allow a section 601 status offense to be converted into a section 602 delinquency through the use of criminal charges brought under Penal Code section 148 -be the offense truancy, insubordination or a curfew infraction (see § 601, subd.(a) ). A minor who disobeys an order by a peace officer to refrain from doing that which the Legislature has declared a status offense is no more a delinquent criminal law violator than a minor *579who disobeys such an order by a juvenile court. Add to that, the comprehensive, non-punitive nature of this state's Compulsory Education Law we have discussed, and a serious question of statutory interpretation arises as to whether it thwarts the Legislature's intent ever to apply Penal Code section 148 to a minor who, non-violently, flouts a peace officer's efforts to secure his *591or her attendance at school (whether by means of a truancy arrest under Education Code section 48264, or by any other method).
It is unnecessary for us to decide that question, however, because we may resolve this case on a narrower ground. That is, a peace officer executing a truancy arrest has no duty to ensure the truant minor actually attends class . Once the minor taken into temporary custody has been delivered "to the school from which the minor [was] absent," by its terms, the arresting officer's statutory duty under Education Code section 48265 has been fulfilled. At that point, responsibility falls to school officials to handle the matter. If the minor thereafter leaves school grounds without attending class then another truancy arrest might very well follow, this time potentially culminating instead with a return to parents or counseling rather than an immediate return to school (see fn. 4, ante ) and, if appropriate, efforts to have the truant minor declared a section 601 ward of the juvenile court as a status offender. But " '[a]s the law now stands, the Legislature has said that if a [truant] wants to run, let him run. While this may be maddening, baffling and annoying to the juvenile court judge, ours is not to question the wisdom of the Legislature.' " ( Michael G. , supra , 44 Cal.3d at p. 292, 243 Cal.Rptr. 224, 747 P.2d 1152, quoting In re Ronald S. , supra , 69 Cal.App.3d at p. 874, 138 Cal.Rptr. 387.)
In this case, once the deputy sheriff delivered R.M. to her high school campus, his statutory duty ended. The People argue he issued a "lawful order" when he thereafter directed R.M. to attend class, but the question is not whether he violated the law when he directed her to class (undoubtedly, he didn't-any more than a school bus driver would for uttering the same directive, or a stranger on the street); the question, rather, is whether he was discharging a legal duty when he did so. The People cite no authority suggesting that he was discharging a duty, and we are aware of none.6 For these reasons, we conclude R.M.'s refusal to obey the deputy sheriff's *592command to go to class did not obstruct, delay or resist his discharge of any legal duty, and therefore the juvenile court erred in finding that she violated Penal Code section 148. *580The People also contend, finally, that the officers had "no choice" but to arrest R.M., because "[h]ad they escorted [R.M.] into the school building, nothing could have deterred or prevented her from leaving, as she said she would, as soon as the officers were no longer present." The latter assertion is true, but irrelevant. It is for the Legislature to decide how to redress a minor's truant behavior and, as discussed, the Legislature has specified that, in appropriate cases, school officials may pursue a section 610 wardship. (And, indeed, in this case they did.) What local law enforcement may not do when a minor who is present at school refuses a directive to attend class is arrest that minor for a violation of Penal Code section 148, backed by the threat of incarceration and the full force of criminal law.
DISPOSITION
The judgment is reversed.
We concur.
KLINE, P.J.
MILLER, J.
Except where otherwise noted, all further statutory references are to the Welfare and Institutions Code.
That provision applies when a minor has more or four truancies in a single school year, or in other specified circumstances in which a minor's habitual truancy is deemed incorrigible. It states in pertinent part: "If a minor has four or more truancies within one school year as defined in Section 48260 of the Education Code or a school attendance review board or probation officer determines that the available public and private services are insufficient or inappropriate to correct the habitual truancy of the minor, ... or if the minor fails to respond to directives of a school attendance review board or probation officer or to services provided, the minor is then within the jurisdiction of the juvenile court which may adjudge the minor to be a ward of the court." (§ 601, subd. (b).) Currently pending before our Supreme Court are the questions whether either school attendance review board proceedings, or a fourth truancy report, are prerequisites to the exercise of juvenile court jurisdiction over a habitual truant under section 601, subdivision (b). (See In re A.N. (2017) 11 Cal.App.5th 403, 217 Cal.Rptr.3d 389, review granted July 19, 2017, S242494.) Nothing in this opinion is intended to express any view on those subjects.
Our conclusion makes it unnecessary to address R.M.'s arguments that she didn't delay or obstruct or resist the deputy sheriff's order to go to class because she hadn't yet left the campus but was merely walking away as if she might do so, and at best reflected an intent to refuse (see In re Amanda A ., supra , 242 Cal.App.4th at pp. 549-551, 195 Cal.Rptr.3d 384 ), and that her actions were protected by the First Amendment.
In full, section 48265 of the Education Code states: "Any person arresting or assuming temporary custody of a minor pursuant to Section 48264 shall forthwith deliver the minor either to the parent, guardian, or other person having control, or charge of the minor, or to the school from which the minor is absent, or to a nonsecure youth service or community center designated by the school or district for counseling prior to returning such minor to his home or school, or to a school counselor or pupil services and attendance officer located at a police station for the purpose of obtaining immediate counseling from the counselor or officer prior to returning or being returned to his home or school, or, if the minor is found to have been declared an habitual truant, he shall cause the minor to be brought before the probation officer of the county having jurisdiction over minors."
As explained by our Supreme Court, " '[t]he status offender is a statutory creation, who occupies a unique position in the juvenile justice system. In contrast to the neglected, dependent or abused child, the status offender comes within the jurisdiction of the juvenile court because of his or her behavior, rather than on a finding of improper parental care or guidance. Unlike children charged with or found guilty of delinquency, alleged or adjudicated status offenders have not committed acts which would be considered criminal if done by an adult. When status offenders are incarcerated, therefore, it is not for any violation of the penal code, but for behavior which is considered unacceptable solely because of their age.' [Citation.] In California, juvenile court jurisdiction over status offenders is conferred by section 601." (In Michael G . (1988) 44 Cal.3d 283, 287, fn. 2, 243 Cal.Rptr. 224, 747 P.2d 1152 (Michael G . ).)
The People contend that In re J.C. (2014) 228 Cal.App.4th 1394, 176 Cal.Rptr.3d 503 supports the court's finding that R.M. refused to obey a lawful order to attend class. We disagree. J.C. affirmed a juvenile court's finding that a hostile and aggressive high school student violated Penal Code section 148 by disobeying the directives of a police officer who had been summoned to the school because the minor was irate and uncontrollable and causing a disturbance. The minor's actions only escalated after the police officer arrived, making violent threats, screaming and yelling and throwing a phone down on a desk when escorted to the vice principal's office and suspended, refused to obey the officer's order to sit down and calm down, and he then physically resisted when the officer tried to detain him for everyone's safety. (See id . at pp. 1396-1397, 176 Cal.Rptr.3d 503.) Not only are the facts of J.C . quite different, the question whether the officer was discharging a legal duty when the minor refused to obey his orders was not at issue. (See id . at p. 1400, 176 Cal.Rptr.3d 503.) And for obvious reason, because it's clearly within the duties of local law enforcement to attempt to defuse a potentially violent disturbance. J.C . has no application here.