
258 Minn. 388 (1960)
104 N.W. (2d) 553
STATE EX REL. K.R. HANSEN
v.
DOUGLAS C. RIGG.
No. 37,962.
Supreme Court of Minnesota.
July 8, 1960.
K.R. Hansen, pro se, for appellant.
Miles Lord, Attorney General, and Charles E. Houston, Solicitor General, for respondent warden.
MURPHY, JUSTICE.
Petitioner applied to the District Court of Washington County for a writ of habeas corpus, alleging that he was unlawfully restrained in the state prison at Stillwater. The district court issued its writ of habeas *389 corpus, and the warden of the state prison filed a return stating that the petitioner was in his custody. According to the record the imprisonment resulted from the following circumstances:
On January 18, 1956, the petitioner was charged by complaint in the municipal court of the city of Mankato of fraudulently issuing a worthless check. The complaint alleged a gross misdemeanor by violation of M.S.A. 622.04. The petitioner entered a plea of guilty to this charge. No judgment of sentence was entered on this plea in the municipal court. On January 25, 1956, another information was filed in municipal court alleging that the petitioner was an habitual offender under § 617.75,[1] and he was bound over to the district court. Thereafter a new information was filed in the district court by which it was charged that the defendant did commit the crime of "Being an Habitual Offender" in that he had within a 5-year period committed three gross misdemeanors, including the one to which he entered a plea of guilty on January 18, 1956. The information concluded that by reason of the facts alleged the defendant was an habitual offender. He entered a plea of guilty to this information and was sentenced to 3 years' imprisonment in the state penitentiary.[2] This sentence was suspended and he was placed on probation, but on November 20, 1958, the stay was vacated on the recommendation of the State Board of Parole and Probation. He was then committed to the state prison where he has since been confined.
Petitioner appeals from an order vacating the writ.
*390 1-2. We cannot agree with the argument of the state that the court had jurisdiction to impose a sentence on the charge to which the petitioner entered a plea of guilty. In a criminal prosecution it is necessary that the trial court have jurisdiction of the subject matter  that is, the offense  as well as the person of the defendant. Jurisdiction of the subject matter is derived from the law.[3] Habitual-criminal statutes do not create a crime. They merely increase punishment for a crime where the defendant has been convicted of prior offenses. The defendant here was not charged with the substantive offense of obtaining money by a worthless check. He was charged with an asserted violation of a statute which does not create a criminal offense. Section 617.75, subds. 1 and 2, provide:
"Every person who shall hereafter be guilty of * * * any misdemeanor or gross misdemeanor involving moral turpitude, who within the previous period of five years shall have been twice convicted in this state of one or more of the offenses hereinbefore named, shall be guilty of being an habitual offender.
"Such person shall be punished for such third offense, * * * if a man above the age of 30 years, by imprisonment in the state prison at Stillwater, for a term of not exceeding three years."
A sentence imposed on an habitual offender is, as the statute provides, imposed as a penalty for the third offense. In State v. Zywicki, 175 Minn. 508, 510, 221 N.W. 900, 901, we explained:
"* * * The information presented to the court for the purpose of showing prior convictions is not an indictment or information charging the defendant with having committed a crime. It merely charges a prior conviction or convictions, which if proved will increase the sentence to be imposed, or already imposed, for the later crime of which defendant then stands convicted."
Courts are agreed that habitual-offender statutes merely define a status justifying a more severe penalty for commission of certain designated crimes because of the prior offenses, and that such statutes do not in themselves define a criminal offense. See, e.g., State ex rel. *391 MacMillen v. Utecht, 221 Minn. 138, 21 N.W. (2d) 239; State v. Hensley, 20 Wash. (2d) 95, 145 P. (2d) 1014; Salisbury v. State, 80 Okl. Cr. 13, 156 P. (2d) 149; Davis v. O'Grady, 137 Neb. 708, 291 N.W. 82; Goodman v. Kunkle (7 Cir.) 72 F. (2d) 334.
The defendant was charged in the district court only with having committed the crime of "Being an Habitual Offender," and therefore he was neither charged with nor convicted of any crime by that court. It must follow that the court was without jurisdiction to impose sentence in this case.
Reversed with directions to reinstate the writ of habeas corpus and direct the warden to release the prisoner.
NOTES
[1]  M.S.A. 617.75 increases punishment for the habitual offender who has been twice convicted within a previous 5-year period for the commission of a "misdemeanor or gross misdemeanor involving moral turpitude," as opposed to § 610.29, which increases the penalty upon conviction of one who has previously been convicted of three or more felonies.
[2]  The petitioner was also sentenced at this time to 3 years' imprisonment for a prior conviction of a felony in 1941 by an Iowa court. These terms were to be served consecutively. The sentence was amended on November 28, 1956, to provide that the terms be served concurrently. The district court in the present action stated, correctly, that the sentence based on a prior conviction, for which the petitioner had already been punished in Iowa, was entirely beyond the power of the Minnesota court and, therefore, void.
[3]  14 Am. Jur., Criminal Law, § 214.
