Petitioner, M.C., seeks certiorari review of a judgment of the Court of Appeals affirming the trial court’s denial of his motion to vacate illegal sentence.1 750 P.2d 69. The Court of Appeals concluded that M.C.’s rights to equal protection of the law as guaranteed by article II, section 25, of the Colorado Constitution and the fourteenth amendment to the United States Constitution were not violated by the disposition ordered in this juvenile proceeding. We affirm, but for reasons differing from those articulated by the Court of Appeals.
I
In August 1985, a petition in delinquency was filed against M.C. containing one count, which alleged that M.C. had commit*859ted the felony offense of second degree burglary, in violation of section 18-4-203, 8B C.R.S. (1978 & 1985 Supp.). In January 1986, an amended petition in delinquency was filed against M.C. The amended petition contained a second count alleging commission of the second class petty offense of possession of not more than one ounce of marijuana, in violation of section 18-18-106(1), 8B C.R.S. (1985 Supp.). On March 27, 1986, M.C., then eighteen years old, entered a plea of guilty to the marijuana possession count. The second degree burglary allegations were then dismissed, and the trial court entered the order of disposition which underlies this proceeding.
The trial court’s dispositional order contains several provisions. The trial court committed M.C. to the Department of Institutions for a period of two years, stayed execution of that sentence, and granted M.C. probation for .an indefinite period not to exceed two years. The trial court also ordered M.C. to serve forty-five days at the Pueblo Youth Center, but suspended the sentence on the condition that in the event any term or condition of probation was violated, M.C. would “serve time in detention for each violation.”2
M.C. was seventeen at the time he committed the acts underlying his adjudication as a delinquent. He was eighteen when the dispositional order was entered on March 27, 1986. At that time, an adult convicted of the offense of possession of not more than one ounce of marijuana was subject to a maximum penalty of a $100 fine. § 18-18-106(1), 8 C.R.S. (1985 Supp.). At the dispositional hearing, M.C. argued that he was subject to the sentencing provisions applicable to adults and that any sentence to the Department of Institutions would violate his constitutional rights to equal protection of the law. M.C. reasserted this position in a Crim.P. 35(c) motion filed subsequent to the entry of the disposi-tional order, citing People in Interest of A.L., 713 P.2d 934 (Colo.App.1985), in support of his argument. The trial court denied the motion. On appeal, a divided panel of the Court of Appeals affirmed the trial court’s ruling, expressly refusing to follow A.L.
II
At the time the order of disposition was entered, the Children’s Code expressly authorized a trial court to adopt one or more of several dispositional provisions. Sections 19-3-113(l)(a) & (c), 8 C.R.S. (1978 & 1985 Supp.),3 contained the following pertinent provisions:
Delinquent child — disposition—restitution — parental liability. (1) If a child has been adjudicated as being delinquent, the court shall enter a decree of disposition containing any required provision and one or more of the following provisions which the court finds appropriate:
(a) The court may make any disposition, or combination of dispositions when appropriate, provided under section 19-3-112(1) or (4) or subsection (3) of this section;
[[Image here]]
(c) The court may commit a person eighteen years of age or over to the department of institutions if he is adjudicated delinquent for an act committed prior to his eighteenth birthday or upon revocation of probation.
Relevant portions of section 19-3-112, 8 C.R.S. (1978 & 1985 Supp.),4 contained the following provisions:
Child needing oversight — disposition. (1) When a child has been adjudicated as needing oversight, the court shall enter a decree of disposition containing one or more of the following provisions which the court find appropriate:
*860(a) The court may place the child on probation or under protective supervision in the legal custody of one or both parents or the guardian under such conditions as the court may impose.
In addition, section 19-3-117, 8 C.R.S. (1978),5 contained the following provisions regarding the granting of probation:
Probation — terms—release—revocation. (1) The terms and conditions of probation shall be specified by rules or orders of the court. The court, as a condition of probation for a child who is fourteen years of age or older but less than eighteen years of age on the date of the dispositional hearing, has the power to impose a commitment, placement, or detention. The aggregate length of any such commitment, placement, or detention, whether continuous or at designated intervals, shall not exceed forty-five days. Each child placed on probation shall be given a written statement of the terms and conditions of his probation and shall have such terms and conditions fully explained to him.
(2)(a) The court shall review the terms and conditions of probation and the progress of each child placed on probation at least once every six months.
(b) The court may release a child from probation or modify the terms and conditions of his probation at any time, but any child who has complied satisfactorily with the terms and conditions of his probation for a period of two years shall be released from probation, and the jurisdiction of the court shall be terminated.
The structure of the trial court’s decree of disposition suggests that it was based in part on section 19-3-117(1). However, that section authorized a “commitment, placement, or detention” for an aggregate length of time not to exceed forty-five days only for children less than eighteen years of age on the date of the dispositional hearing. M.C. was not such a person on March 27, 1986. The only provisions of section 19-3-117 applicable to M.C. were subsections (2)(a) and (b), requiring the trial court periodically to review the progress of any child placed on probation and requiring the termination of probation at the end of a period of two years.
Section 19-3-113(l)(c) did authorize a trial court “to commit” a person eighteen years of age or over to the Department of Institutions. Section 19-3-112(l)(a) authorized the placement of a child on probation. M.C. challenges only the portions of the decree of disposition which were based on these statutory provisions.6
M.C. argues that every child has a constitutionally protected liberty interest. M.C. then asserts that this interest is impermis-sibly restricted by a statutory scheme permitting one class of persons — those who are eighteen years of age or older when penalties are imposed for offenses committed when they were also eighteen years of age or older — to pay a fine upon conviction of possession of marijuana while permitting another class of persons — those who are eighteen years of age or older when penalties are imposed for commission of the same offense when they were under eighteen years of age — to be sentenced to the Department of Institutions or placed on probation for a period of two years. M.C. suggests that our decisions in People v. Wilhelm, 676 P.2d 702 (Colo.1984), and People v. McKenzie, 169 Colo. 521, 458 P.2d 232 (1969), wherein we concluded that constitutional guarantees of equal protection of the law are violated when two statutes authorize different punishments for *861the same criminal conduct, support his argument.
We do not find M.C.’s arguments persuasive. Initially, it must be noted that, unlike the circumstances in Wilhelm and McKenzie, we are not dealing with two criminal statutes. The elaborate disposi-tional structure of the Children’s Code is designed to further the purposes of that statute, stated in section 19-1-102(1), 8 C.R.S. (1978 & 1985 Supp.),7 as follows:
Legislative declaration. (1) The general assembly declares that the purposes of this title are:
(a) To secure for each child subject to these provisions such care and guidance, preferably in his own home, as will best serve his welfare and the interests of society;
(b) To preserve and strengthen family ties whenever possible, including improvement of home environment;
(c) To remove a child from the custody of his parents only when his welfare and safety or the protection of the public would otherwise be endangered and, in either instance, for the courts to proceed with all possible speed to a legal determination that will serve the best interests of the child; and
(d) To secure for any child removed from the custody of his parents the necessary care, guidance, and discipline to assist him in becoming a responsible and productive member of society.
In recognition of the benevolent purposes of the act, we have consistently recognized that the proceedings authorized thereunder are civil rather than criminal in nature. S.G.W. v. People, 752 P.2d 86, 88 (Colo.1988); S.A.S. v. People, 628 P.2d 58, 60 (Colo.1981); People in Interest of R.A.D., 196 Colo. 430, 433, 586 P.2d 46, 47-48 (1978); People ex rel. Terrell v. District Court, 164 Colo. 437, 444, 435 P.2d 763, 766 (1967).
Criminal codes are designed for quite different purposes. It is of course true that many of the procedural protections afforded persons accused of criminal conduct are also available to persons defined as children to ensure fundamental fairness in juvenile proceedings. See, e.g., In re Winship, 397 U.S. 358, 90 S.Ct. 1068, 25 L.Ed.2d 368 (1970); In re Gault, 387 U.S. 1, 87 S.Ct. 1428, 18 L.Ed.2d 527 (1967); J.T. v. O’Rourke, 651 P.2d 407 (Colo.1982); People in Interest of C.B., 196 Colo. 362, 585 P.2d 281 (1978). However, that fact may not serve to obscure the fundamental differences between the two types of legislation.
In recognition of these differences, some courts have suggested that persons subject to statutory schemes similar to the Children’s Code do not constitute a class similarly situated to adults subject to statutory provisions imposing sanctions for criminal conduct. See In re Eric J., 25 Cal.3d 522, 601 P.2d 549, 159 Cal.Rptr. 317 (1979). The Court of Appeals adopted this perspective in concluding that the class to which M.C. belonged was not substantially similar to the class composed of adults subject to the Criminal Code. However, for purposes of determining whether provisions of the Children’s Code authorizing commitment to the Department of Institutions and the imposition of a lengthy period of probation violate equal protection guarantees, we are persuaded that the fact that some eighteen year old persons are defined as children and, consequently, are granted special treatment does not render that class dissimilar to the class of other eighteen year olds not so defined. In examining the sanctions adopted by the General Assembly for the same criminal conduct, the relevant classes are: (1) persons eighteen years of age or older at the time a penalty is imposed for an offense committed prior to their eighteenth birthdays and (2) persons eighteen years of age or older at the time the penalty is imposed for the same offense who were also eighteen years of age or older when they committed the offense.8 *862Of course, the primary legislative focus is on persons who commit the offense. We conclude that, contrary to the decision of the Court of Appeals, the class to which M.C. belongs is similarly situated to the class of adults subject to the sanctions contained in the Criminal Code.
Ill
We must next determine the standard by which the dispositional alternatives adopted by the General Assembly are to be measured. If M.C.’s protected liberty interest is not deemed fundamental in nature, the legislation challenged as imper-missibly restricting that interest is measured by the rational relationship test: whether the statute serves a valid governmental purpose and whether the challenged provisions are reasonably related to that purpose. Austin v. Litvak, 682 P.2d 41, 49 (Colo.1984); People v. Chavez, 629 P.2d 1040, 1051 (Colo.1981). Some courts have concluded that the liberty interests of children, while significant, are not fundamental in nature and that legislation restricting such interests is to be measured by the rational relationship test. See In re Eric J., 25 Cal.3d 522, 601 P.2d 549, 159 Cal.Rptr. 317 (1979); Smith v. State, 444 S.W.2d 941 (Tex.Civ.App.1969).
When a fundamental liberty interest is involved, however, legislative classifications are to be examined by a heightened standard, often denominated the strict scrutiny test. Austin v. Litvak, 682 P.2d at 49. In these circumstances, the state must demonstrate that the legislation serves a compelling state interest and that the challenged statutory provisions are necessary to further that interest. Some courts have determined that the liberty interest of a child is a fundamental interest requiring application of strict scrutiny standards to legislation restricting that interest. See, e.g., Matter of C.H., 210 Mont. 184, 683 P.2d 931 (1984); State v. Rice, 98 Wash.2d 384, 655 P.2d 1145 (1982).
This court has recognized that commitment implicates a “protectible liberty interest” of children. S.G.W. v. People, 752 P.2d 86, 88 (Colo.1988); P.F. v. Walsh, 648 P.2d 1067, 1070 (Colo.1982). However, this court has not described that interest as fundamental in nature. See Villareal v. Lopez, 44 Colo.App. 555, 619 P.2d 86 (1980). To the contrary, in People in Interest of J.M., 768 P.2d 219 (Colo.1989), we concluded that a child’s liberty interest in being free to travel was not a fundamental right requiring application of strict scrutiny analysis to a municipal ordinance restricting the ability of persons under eighteen years of age to remain on the public streets of the city.
In several other cases addressing equal protection challenges to various provisions ,of the Children’s Code, we have also applied a rational relationship test to measure the contested sections. See People in Interest of T.M., 742 P.2d 905 (Colo.1987); People in Interest of D.G., 733 P.2d 1199 (Colo.1987); People v. Thorpe, 641 P.2d 935 (Colo.1982); Myers v. District Court, 184 Colo. 81, 518 P.2d 836 (1974). It is also noteworthy that the liberty interest asserted by M.C. is that of a person adjudicated a delinquent child under the Children’s Code — an interest that is neither as broad nor as compelling as the liberty interest of a person not so adjudicated. See People v. White, 656 P.2d 690 (Colo.1983).
In consideration of these principles and our prior decisions, we conclude that the interest of M.C. here involved, while significant, is not so fundamental in nature as to require application of the strict scrutiny standard. In so concluding, we reject the Court of Appeals contrary suggestion that the nature of M.C.’s liberty interest is so fundamental in nature as to warrant strict scrutiny analysis of the dispositional provisions relied upon by the trial court. Accordingly, we measure the challenged statutory provisions by the rational relationship test.
It is undisputed that the state has a significant interest and legitimate role in supervising and regulating the conduct of children for their protection. People in Interest of J.M., 768 P.2d at 222; People in *863Interest of T.M., 742 P.2d at 907; S.A.S. v. District Court, 623 P.2d 58, 60 (Colo.1981). That role serves as the motivating force as well as the legal justification for all of the provisions of the Children’s Code. The conclusion that some children might benefit from probation for a lengthy period of time is based on experience as well as theory. The provisions authorizing relatively lengthy terms of probationary status, with mandatory periodic judicial review, are calculated to assist children to adjust to the requirements of adult participation in the community. We find these provisions reasonably related to the purposes of the Children’s Code.
We also conclude that the provision authorizing commitment to the Department of Institutions for a period of two years is reasonably related to the legislative purposes underlying the Children’s Code. Among those purposes are to remove a child from the custody of the child’s parents when the public would otherwise be endangered and to secure the necessary care, guidance and discipline for a child removed from parental custody. § 19-l-102(l)(c) & (d), 8 C.R.S. (1978 & 1985 Supp.).9 While confinement in the custody of the Department of Institutions might well be deemed a harsh dispositional alternative, the legislative scheme authorizing such confinement cannot be deemed unrelated in reason to the beneficial, disciplinary and protective purposes of the statutory scheme.
M.C. argues that a contrary result is required in view of the decision in People in Interest of A.L., 713 P.2d 934 (Colo.App.1985). In A.L., the court vacated a trial court’s dispositional order imposing a six month county jail sentence on a child who was eighteen years of age at the time of the dispositional hearing and who had committed the same offense M.C. committed. The defendant contended that the trial court erred in imposing the jail sentence, and the People conceded that the disposition was improper. The court, relying on People v. Wilhelm, 676 P.2d 702 (Colo.1984), and P.F. v. Walsh, 648 P.2d 1067 (Colo.1982), stated that it concurred with the People’s position.
In the present case, the majority of the panel declined to follow A.L. The dissenting judge considered A.L. to be persuasive and controlling. It is not clear from the opinion in A.L. precisely what grounds the defendant relied upon for the argument that the trial court’s dispositional order was improper. Because the dispositional provision adopted by the trial court in A.L. differs significantly from that chosen by the trial court here, we do not view A.L. to be applicable to the circumstances of this case.
IV
For the foregoing reasons, we affirm the conclusion reached by the Court of Appeals that the provisions of the Children’s Code authorizing commitment to the Department of Institutions for a period not to exceed two years and authorizing a grant of probation for a similar period of time do not violate M.C.’s rights to equal protection of the law under the Colorado Constitution or the United States Constitution. As indicated by our opinion, however, we do so on grounds that differ from those underlying the Court of Appeals decision.
The judgment is affirmed.
ERICKSON, J., specially concurs. QUINN C.J., and VOLLACK, J., join in the concurrence. MULLARKEY, J., dissents.. The motion was apparently filed pursuant to Crim.P. 35(c).
.The order contains other provisions not relevant to this proceeding, including numerous terms and conditions of probation. M.C. does not challenge any of the terms or conditions of probation, or the appropriateness of the imposition and conditional suspension of the sentence to the Pueblo Youth Center.
. This statute was repealed and reenacted in 1987. It is now codified as § 19-2-703, 8B C.R.S. (1988 Supp.).
. Section 19-3-112 was repealed in 1986. Ch. 144, § 16, § 19-3-112, 1986 Colo.Sess.Laws, 795.
. This statute was repealed and reenacted in 1987. It is now codified as § 19-2-705, 8B C.R.S. (1988 Supp.).
. In People v. District Court, 673 P.2d 991 (Colo.1983), we reversed a decree of disposition that denied probation, imposed a sentence to the Department of Corrections and then suspended the sentence and committed the defendant to the supervisory services of the Probation Department. Noting that the terms and conditions imposed by the trial court were authorized only as terms and conditions of probation, we held that the decree exceeded the statutory authority of the court. Id. at 995. In this case, the trial court’s decision to commit M.C. to the Department of Institutions was expressly authorized by the statute. M.C. does not challenge the trial court’s decision to suspend the commitment.
. This statute was repealed and reenacted in 1987. It is now codified as § 19-1-102, 8B C.R.S. (1988 Supp.).
. Persons committing an offense just prior to their eighteenth birthday might not receive a dispositional order until they are nineteen, and commitments to custody might be imposed as *862sanctions for probation violations on nineteen year olds.
. See n. 7.