
265 P.2d 226 (1953)
RIVERA
v.
PEOPLE.
No. 17131.
Supreme Court of Colorado, En Banc.
December 28, 1953.
*227 Isaac Mellman and Gerald N. Mellman, Denver, for plaintiff in error.
Duke W. Dunbar, Atty. Gen., Frank A. Wachob, Deputy Atty. Gen., for defendant in error.
MOORE, Justice.
This case involves proceedings in the trial court in which plaintiff in error was defendant in a criminal prosecution for burglary, and we will hereinafter refer to him as defendant.
The facts material in the consideration of this cause are not in dispute. In the fall of the year 1944 defendant, who then was sixteen years of age, was arrested and confessed to police officers of Denver that he had committed some twenty-nine burglaries in and around Denver. One of these crimes was committed on January 11, 1944, in the County of Jefferson, in the perpetration of which he used, or attempted to use, "dynamite, nitroglycerin or gunpowder." At the time of his arrest defendant had not been convicted of a crime, and then was a first offender within the meaning of section 512, chapter 48, '35 C.S.A., which provides, inter alia, that, "Courts having criminal jurisdiction in Colorado shall sentence to the state reformatory all male persons, and none other, duly convicted before them of felony for the first time, who shall at the time of sentence be of the full age of sixteen (16) years, and not more than twenty one (21) years of age; * * *."
Following the arrest of defendant, an information was filed against him based upon one of the burglaries in Denver. This prosecution resulted in a judgment of guilt and sentence was imposed by the district court of Denver, under which defendant was confined in the state reformatory. Upon his release from the reformatory he was taken into custody by the sheriff of Jefferson county under process issued in a case which was based upon the burglary committed in that county on January 11, 1944. The first count of this information charged a burglary by defendant, in the perpetration of which he allegedly used, or attempted to use, explosives. This offense is punishable by a minimum sentence of twenty-five years imprisonment. Chapter 48, section 83, *228 '35 C.S.A. Defendant was convicted on three counts upon the trial of that case and the district court of Jefferson county imposed sentences to run concurrently. The longest imprisonment was adjudged on the first count, upon which defendant was sentenced to twenty-five years minimum term in the penitentiary. This sentence was pronounced notwithstanding the fact that defendant was then of the age of eighteen years, and that at the time of the act of which complaint was made he had not been convicted of a felony.
Defendant was received at the state penitentiary where he remained for a little more than five years. His sentence was commuted to "not less than 12 nor more than 26 years," and he was paroled in April, 1951. In July, 1952, the Parole Department filed a petition to revoke the parole.
Defendant, appearing by counsel who represents him in the present proceedings, filed a petition in the district court of Jefferson county asking that the judgment and sentence of twenty-five years be declared void on several grounds, among which it was asserted that at the time of imposition or sentence defendant was only eighteen years of age and that, under the abovementioned statute, and the admitted facts, the sentence to imprisonment in the penitentiary was void. This petition was denied.
December 8, 1952, the district court of Jefferson county made its "Findings, Conclusions and Recommendations," on the petition for revocation of defendant's parole, in which it was recommended that he remain on probation.
December 22, 1952, the State Board of Parole revoked defendant's parole, notwithstanding the recommendation of the court to the contrary. Defendant was returned to the penitentiary and his counsel filed in the Jefferson county district court a petition for writ of habeas corpus. The writ issued and the return of the warden set forth pertinent portions of the above stated facts. Upon trial of the habeas corpus issues the full record, including the transcribed testimony in the case resulting in the twenty-five year sentence, was offered and received in evidence. In denying the relief sought by defendant in this particular, the trial court said, inter alia:
"This proposition presents a novel and serious question. If the sentence to the State Penitentiary was invalid and void, as petitioner contends, then his application for writ of habeas corpus is proper. However, assuming the facts in the case to be as set forth in paragraph 6 of the petition, we conclude that the judgment and sentence would be erroneous and not void. Hart v. Best, 119 Colo. 569 [205 P.2d 787], and other Colorado cases.
"Thus the judgment and sentence being irregular and not void, if we are correct in our appraisal thereof, the same may be corrected by the Supreme Court on writ of error or by the court which pronounced it; but, according to Hart v. Best supra, such correction cannot be accomplished in a habeas corpus proceeding.
"We therefore conclude on the three propositions set forth in the petition for a writ of habeas corpus and the return thereto that the writ should be discharged.
"In Smith v. Best, 115 Colo. 494 [176 P. 2d 686], in the last paragraph of the opinion, Mr. Justice Burke makes the following statement of a defendant who found himself in a situation similar to that in which we now believe Rivera to be:
"`Should the defendant so elect, his petition for habeas corpus may be treated as a petition for the entry of a proper judgment, and for that purpose the trial court may retain jurisdiction, require the presence of defendant, and, guided by the foregoing and our opinions cited, supra, amend the original sentence by including therein a minimum term of imprisonment.'
"Guided by this suggestion and in the interests of saving time, considering the importance of the case, and in view of the fact the file in case 1748, including the transcript of the remarks of the Court at the time of passing sentence and a full transcript of the testimony, we have considered proposition No. 3 set forth above in the light of a petition for a request to correct the sentence in accordance with petitioner's theory that he should have been sentenced *229 to the reform school at Buena Vista instead of the State Penitentiary; although we recognize that petitioner's theory also is that he now should be released because of his having served a term in the Penitentiary and that he has more than satisfied any sentence which he should properly have been given to the State Reformatory." (Emphasis supplied.)

* * * * * *
"We feel confident that counsel for petitioner will desire to have this decision reviewed by our Supreme Court and we sincerely trust and hope that the same shall be done, because we do not want Rivera to spend his days in the State Penitentiary under our sentence if in right and justice he does not belong there. We trust we have proceeded properly in considering proposition No. 3 not only as a basis for habeas corpus but also as a basis for correction of sentence, thus possibly permitting the whole problem to be presented for review. A new trial is considered unnecessary and motion therefor is hereby dispensed with."

Questions to be Determined.
First: When a youth has committed a number of offenses for which, upon conviction of any one thereof, the law requires imposition of a sentence to the reformatory; after conviction of one of said crimes and after completion of such sentence, can another prosecution, based upon one of the offenses committed prior to the first conviction, result in imprisonment in the penitentiary, notwithstanding the fact that at the time of the imposition of such sentence defendant is only eighteen years of age?
This question is answered in the negative. The law applicable at the time of the commission of an offense under all the facts and circumstances thereof must govern and control any prosecution based thereon. The date of the offense here involved was January 11, 1944. It is admitted that as of that date the only lawful sentence which could be imposed upon defendant was confinement in the reformatory for an indeterminate period. No other prosecution for some other crime could serve to modify or change the punishment to which defendant might be subject under the facts and the law as of January 11, 1944. The law enforcement officers were powerless to increase or in any way modify the possible sentence by delaying proceedings until after conviction of defendant was secured for some other offense, and the completion of the sentence upon said conviction did not in any way subject defendant to an increased penalty for an act committed long prior to any conviction of crime.
Second: Is habeas corpus available to defendant as the proper procedure to afford relief?
This question is answered in the affirmative. Our court in People ex rel. Metzger v. District Court, 121 Colo. 141, 215 P.2d 327, 331, said:
"It may be stated as a general rule that in a habeas corpus action by a person convicted of a crime the sole question for consideration is whether the petitioner therein was convicted in a court having jurisdiction of his person and of the charge in the information, and the judgment and sentence were within the statutory limitations."
It is clear, in the instant case, that the judgment and sentence were not within the statutory limitations. In considering whether a sentence is within the provisions of the statute fixing the penalty for the commission of a crime, the statute which requires commitment to the reformatory in certain cases is fully applicable and must govern when the pertinent facts are present. A judgment and sentence to the penitentiary for any term, when the law requires a reformatory confinement, is a void judgment and habeas corpus is a proper remedy to afford relief. From the foregoing it follows that the confinement of defendant in the penitentiary was and is without authority of law, and all proceedings dealing with commutation of sentence and parole were without force and effect.
The judgment accordingly is reversed and the cause remanded with direction to forthwith release and discharge defendant from custody. Any petition for rehearing in this cause shall be filed within five days from the date of announcement of this opinion.
