
141 N.W.2d 15 (1966)
STATE of Minnesota ex rel. Michael Patrick AHERN, Appellant,
v.
Jack G. YOUNG, Superintendent of Minnesota State Reformatory for Men, Respondent.
No. 40105.
Supreme Court of Minnesota.
February 25, 1966.
*16 John R. Peterson, Albert Lea, for appellant.
Robert W. Mattson, Atty. Gen., Linus J. Hammond, Asst. Atty. Gen., Gerard W. Snell, Sol. Gen., St. Paul, for respondent.
ROGOSHESKE, Justice.
Appeal from an order discharging a writ of habeas corpus and remanding petitioner to respondent for execution of a 3-year sentence imposed upon his conviction of forgery. The question for decision is whether petitioner is entitled to credit toward the expiration of his sentence for time spent on probation.
Following his plea of guilty to forgery, petitioner was sentenced on July 10, 1962, for a term not to exceed 3 years. On that date the court entered an order staying the execution of the sentence and placing petitioner on probation on the conditions that he serve 90 days in the Freeborn County jail with credit for time already served therein; that he make restitution of the forged check within 1 year; and that he be placed under the supervision of the commissioner of corrections subject to all rules and regulations of his supervising agent. He was released from the county jail on July 30, 1962, and continued on probation for almost 1½ years, when, pursuant to Minn. St. 609.14 (L.1963, c. 753, § 609.14), the stay and probation were revoked after hearing and petitioner ordered committed to serve the sentence previously imposed. At the time of filing his application for the writ, he had been confined either in the county jail or State Reformatory and under probation for 81 days more than the maximum period of the 3-year sentence imposed.
Petitioner urges us to recognize probation as a form of punishment, however ambulatory or mild. He contends that the severe restraints placed upon a probationer[1] are *17 such that he is not a free man but is under the constant surveillance, control, and custody of the court, subject to compliance with any special conditions imposed and obedience to the rules and regulations of his supervising authority. He then argues that equating probation with punishment (or imprisonment) reveals that each has essentially identical attributes. Thus, unless credit is given for time spent on probation, petitioner will be punished far beyond the sentence imposed. He points out that conceivably probation could be revoked on the last day of his 3-year term. With no credit given, he could be subjected to 3 more years of punishment, or almost double the maximum period of the original sentence, and such treatment would, he claims, amount to involuntary servitude and violate his constitutional rights against cruel and unusual punishment. Petitioner contends that no statutory provision expressly denies or grants credit and argues that the court is therefore free to grant credit to prevent injustice. Finally, he argues that parole and probation are identical in character, imposing like restraints, and because Minn.St. 243.18[2] grants credit to parolees for time served on parole, denying credit for time served on probation is discriminatory against probationers in violation of the equal-protection and due-process clauses of the Federal and state constitutions.
We have carefully weighed petitioner's ingenious arguments, but in the face of what we believe to be clear and binding statutory direction to the contrary we cannot grant the relief requested.
1. Determination of what conduct constitutes a criminal offense and the punishment that ought to be imposed (including the terms and conditions of probation, confinement, and parole) is pecularly a legislative and not a judicial function. Contrary to petitioner's position, the pertinent statutory provisions make clear the legislative intent that no credit should be allowed for time served on probation. Section 609.14, subd. 3(2) (L.1963, c. 753, § 609.14, subd. 3[2]), expressly provides that upon revocation of the stay of sentence and probation the court is authorized either to continue the probation or "order execution of the sentence previously imposed."[3]*18 This provision supplants Minn.St.1961, § 610.39, which provided, perhaps more clearly, that upon revocation of the order staying sentence, "the sentence theretofore imposed shall be executed in all respects as though no proceedings [with respect to probation] * * * had been taken."
Additional statutory references also reveal a legislative policy against credit for probation. Comments by Professor Maynard E. Pirsig, reporter for the advisory committee which assisted in drafting the Criminal Code of 1963, indicate that during legislative hearings a modification was made in § 609.14 to provide that, upon notice that a probationer has violated any of the conditions of probation, "the court may without notice revoke the stay [of execution of sentence] and probation * * *."[4] The language was inserted to cover the case where a probationer violates the terms of his probation but cannot be found before the period of probation expires. Thus, the court may revoke the stay and terminate the probationary status, and upon return of defendant and after hearing, may make either order authorized by subd. 3, notwithstanding the probationary period would have expired if not so suspended. This provision necessarily contradicts any intent by the legislature to allow credit since, if the period of probation continued to run and expired before the probationer was found and heard, it would necessarily bar any further action by the court.[5]
Legislative intent to deny credit can also be gathered from those provisions of the new criminal code which provide revocation of the stay and probation can only become effective after notice and hearing. Previously no notice and hearing were required. This modification reveals a legislative policy requiring that probation be revoked only for a substantial violation. This policy in turn reflects an intent not to allow credit, for upon revocation, if commitment were limited to only the term of the sentence remaining, the violation need not be substantial or deserving of careful scrutiny.
Additionally, the Criminal Code of 1963 now provides that probation can be granted before as well as after imposition of sentence,[6] unmistakably authorizing imposition of the full sentence despite granting probation before the sentence was pronounced. Such intent appears inconsistent with a legislative policy favoring credit.[7]
We point, also, to judicial dicta buttressing our conclusion that legislative intent is opposed to allowing credit. In Breeding v. Swenson, 240 Minn. 93, 60 N.W.2d 4, petitioner's probation was revoked and his original sentence reinstated. Dicta of the court considered the consequences of petitioner's revoked probation under the previous criminal code (240 Minn. 97, 60 N.W. 2d 8):
"* * * [T]he court, as authorized by § 610.39, revoked the stay of execution *19 of the sentence with the result that the original sentence was reinstated. In the exercise of its discretion a trial court may, at any time and without notice, constitutionally vacate a stay of execution and reinstate the original sentence * * *."
Further support is found in State ex rel. Morris v. Tahash, 262 Minn. 562, 115 N.W. 2d 676, which includes the following dicta (262 Minn. 566, 115 N.W.2d 679):
"* * * That a court may vacate a stay of execution and reinstate an original sentence at any time without notice is well established."[8]
2. We consider next petitioner's constitutional objections, primarily his claim of unequal protection of the laws.
Whether the protection of the laws is unequal, and hence unconstitutional, depends upon a finding that a legislative enactment operates in a different way upon those who belong to the same class.[9] We agree with petitioner that the legislature treats probationers and parolees differently in granting credit for time served on parole while denying it for probation. We are not unmindful of State ex rel. Lutz v. Rigg, 256 Minn. 241, 98 N.W.2d 243, which holds that, upon revocation of parole, the original sentence may be imposed and defendant shall receive no credit for time served on parole. However, Minn.St.1961, § 243.18, in force at the time, was neither raised nor considered in that case. That statute expressly provides that credit be given for good time, and we believe a policy is clearly implied that credit be given for all time on parole.[10] Furthermore, it seems anomalous to provide for good time earned while serving parole without considering that the time served is also earned and credited.
But, though credit is granted for parole yet denied for probation, there is no denial of equal protection because, in our view, parolees and probationers are not of the same class. While probation may be considered a mild form of ambulatory punishment imposing meaningful restraints, its true nature is an act of judicial grace. The legislature has granted to the judiciary discretionary power to grant probation as a means of testing a convicted defendant's integrity and future good behavior. Unlike parole, granted by an administrative agency, probation is granted by the court when the sentencing judge deems the protection of society does not demand immediate incarceration. It is not granted because of any merit or worthiness of the wrongdoer. Parole is the result of an investment of discipline in a prisoner who has earned the rewards of a milder form of punishment. The parolee has demonstrated an empirical need for a new form of punishment more effectively suited to prepare him for society and to his rehabilitation.
These differences lend meaning to the legislative intent to deny credit for probation. One who has been convicted of a crime, has received no punishment, and has proved nothing as to his ability to submit to rigid discipline is simply not entitled to the same concessions as one who has been punished and demonstrated an *20 ability to reform. Further, if credit were required to be given, it is foreseeable that a sentencing court would be less inclined to impose the risks of probation upon society, knowing that such concessions might hinder communicating to the defendant the full impact of responsibility for his acts and, possibly, frustrate rehabilitation. The effect upon a probationer could well be less respect for the restraints of probation and obedience to the law, with increased danger of recidivism. It is essential that a court should retain the threat of the original sentence upon breach of probation in order more effectively to discipline a probationer and protect against the risk of repeated injury to society.
As probationers and parolees are therefore of different classes, we hold there is no violation of the equal-protection clause.
3. We find no merit in petitioner's contention that failure to grant credit results in involuntary servitude and cruel and unusual punishment. Punishment for criminal behavior has always been a recognized exception to the prohibition against involuntary servitude.[11] It is a necessary response to any person's unlawful conduct that he be punished to whatever extent is reasonably likely to insure society's protection. It is believed that often probation may better serve society's needs, but if a probationer violates the terms of his probation he has demonstrated by his own acts his need for imprisonment, for which he can hardly be heard to complain by labeling it involuntary servitude. The legislative and judiciary have together extended to petitioner, by an act of grace, an opportunity to demonstrate that imprisonment was unnecessary to his rehabilitation. When he proved otherwise, the constitution cannot be used as a legal shield to protect him from his just desert.
It is also impossible for us to conceive how, when petitioner is given an opportunity to escape imprisonment, he can successfully complain of cruel and unusual punishment when, understanding the consequences, he knowingly forfeits that opportunity by his own misconduct.
Petitioner's alarm that conceivably a probationer with 1 day left could lose his status by revocation and receive the full sentence, while having no constitutional significance, could be a serious concern in some cases. However, safeguards against possible injustice do presently exist. For instance, any injustice visited upon a person receiving this kind of treatment can be adjusted by the Adult Corrections Commission in determining when parole should be granted. That agency has authority to release a prisoner at any time after confinement and would undoubtedly do so long before the expiration of his sentence if the condition of probation violated was not such as would indicate recidivist behavior. The impact of violating probation could also be alleviated by the court's strong recommendation to the commissioner of corrections that, in light of the nature of defendant's violation, imprisonment should be for no longer than would be necessary to teach obedience to the rules and regulations of probation or parole. Moreover, § 609.14, subd. 3(2), provides that upon violation of probation the sentencing judge may "place the defendant on probation in accordance with the provisions of section 609.135," thereby forestalling imprisonment.
For that presumably small class of probationers who suffer the fate of losing probationary status on the evening of discharge without hope of just treatment by the Adult Corrections Commission, we offer the suggestion to the legislature that the sentencing court might properly be given discretionary authority upon revocation of probation to modify the sentence previously imposed. Precedent is available for such an enactment in 62 Stat. 842, as amended by 63 Stat. 96, 18 U.S.C.A. § 3653, which provides *21 in part that the court may revoke probation and require the prisoner to serve the sentence imposed "or any lesser sentence * * *." (Italics supplied.) Such an amendment to our statute, while not compelling, may be a desirable additional safe guard to those now accorded probationer upon the revocation hearing.
Affirmed.
NOTES
[1]  Petitioner signed a probation agreement July 16, 1962, including the following restrictions:

"I. General Rules:
"I will abide by the general rules for probationers which are:
"a. I will obey all laws, avoid doubtful companions, avoid the excessive use of intoxicants, keep reasonable hours, and stay out of objectionable places.
"b. I will consult my Probation Agent for permission to:
"1. Buy or drive an automobile or any other vehicle.
"2. Borrow money or go into debt.
"3. Change employment or residence.
"4. Leave the community.
"c. Through my Agent, I will request permission from the Adult Corrections Commission to:
"1. Leave the state.
"2. Marry.
"d. I will not associate, correspond or communicate with persons who are on parole or probation without the knowledge and consent of my Agent.
"e. I will immediately contact my Agent in case of any difficulty.
"f. I will cooperate with my Agent and be guided by his advice in all matters affecting my probation.
"II. Monthly Report:
"I will send a monthly report on the first day of each month to my Probation Agent using the blanks furnished by the Commissioner of Corrections.
* * * * *
"IV. Special Conditions:
"I will abide by the following special conditions set forth by the Court in my sentence:
"1. Make restitution within one year.
"2. Serve 90 days in the Freeborn County Jail."
[2]  Minn.St. 243.18 reads in pertinent part as follows: "Every convict sentenced for any term other than life, whether confined in the state prison, the state reformatory, or the state reformatory for women, or on parole therefrom, may diminish the term of his sentence as follows:

"(1) For each month, commencing on the day of his arrival, during which he has not violated any prison rule or discipline, and has labored with diligence and fidelity, five days;
"(2) After one year of such conduct, seven days for each month;
"(3) After two years of such conduct, nine days for each month;
"(4) After three years, ten days for each month for the entire time thereafter."
[3]  It should be noted that § 609.14, subd. 3(2) provides that upon violation of the conditions of probation, the court may continue probation or order execution of the sentence previously imposed, but no alternative provision is made, as in 62 Stat. 842, as amended by 63 Stat. 96, 18 U.S.C.A. § 3653, whereby the court may require the prisoner to serve "the sentence imposed, or any lesser sentence * * *." (Italics supplied.) Absence of such a provision in our statute seems to contradict an implication of authority to allow credit. To hold that credit could be given would be to permit a trial judge to modify a valid sentence, clearly a contravention of case law. State v. Carlson, 178 Minn. 626, 228 N.W. 173. See, also, State ex rel. Bennett v. Rigg, 257 Minn. 406, 102 N.W.2d 17.
[4]  Comment, 40 M.S.A. p. 139.
[5]  Minn.St. 609.135 (L.1963, c. 753, § 609.135) limits the period of probation in felony cases to the maximum period for which the sentence of imprisonment might have been imposed.
[6]  Minn.St. 609.135, subd. 1 (L.1963, c. 753, § 609.135, subd. 1).
[7]  It should be noted, however, that this newly authorized practice, if employed in a deserving case, would enable the sentencing judge upon revocation of probation to, in effect, give credit by limiting the sentence imposed.
[8]  See, also, State ex rel. Newman v. Wall, 189 Minn. 265, 249 N.W. 37; State v. Chandler, 158 Minn. 447, 197 N.W. 847. Both cases involved the question whether, in a trial court's discretion, petitioner's probation could be revoked without notice. Both held in the affirmative, citing the same provision as Minn. St.1961, § 610.39. State ex rel. Naus v. Rigg, 250 Minn. 365, 84 N.W.2d 698, certiorari denied, 355 U.S. 884, 78 S.Ct. 153, 2 L.Ed.2d 114, and State ex rel. Jenks v. Municipal Court, 197 Minn. 141, 266 N.W. 433, demonstrate by their facts that petitioners were given no credit for time served on probation.
[9]  State v. Meyer, 228 Minn. 286, 304, 37 N.W.2d 3, 14.
[10]  Minn.St.1961, § 243.18, has been so interpreted by the Adult Corrections Commission, and credit is actually given to parolees for the period plus good time spent on parole. The commissioner "may take away any or all of the good time previously gained * * *."
[11]  Draper v. Rhay (9 Cir.) 315 F.2d 193, 197; United States v. Dowd (7 Cir.) 271 F.2d 292, 294.
