
149 N.W.2d 384 (1967)
STATE of Minnesota, Respondent,
v.
Donald MINTON, Appellant.
No. 40337.
Supreme Court of Minnesota.
March 17, 1967.
*385 John P. Weber, Grand Rapids, for appellant.
Douglas M. Head, Atty. Gen., Gerard W. Snell, Sol. Gen., St. Paul, John Plattner, County Atty., Walker, for respondent.

OPINION
PETERSON, Justice.
Defendant appeals from a theft conviction, upon his own plea of guilty, for which he was sentenced to an indeterminate term in the State Prison. Defendant claims, and the state now concedes, both that the court was without jurisdiction over the subject matter of the crime and that he was denied substantial due process in regard to the sentence imposed. We agree and reverse with directions.
Defendant was arraigned on May 24, 1965, upon an information charging him with the crime of burglary pursuant to Minn.St. 609.58, subd. 2(3).[1] The substance *386 of the charge was that on May 16, 1965, in Cass County, defendant broke and entered a garage appurtenant to the dwelling of one Ross Gildow and stole Gildow's roto-tiller therefrom. Defendant pleaded not guilty.
The state thereupon, pursuant to an agreement between the county attorney and court-appointed counsel for defendant, moved to change the charge to theft, pursuant to § 609.52, subds. 2(4) [sic] and 3 (4).[2] The effect, of course, was to eliminate the charge of breaking and entering Gildow's building and to charge only the theft of Gildow's roto-tiller. But no new information was filed setting forth that charge. Defendant pleaded guilty to theft, and after presentence investigation was sentenced on August 10, 1965.
1. The court did not have jurisdiction over the subject matter of the crime for which defendant was convicted simply because there was no information charging him with that crime. Although a court may permit a defendant to plead guilty to a lesser included offense without delivery of a new information or indictment,[3] the crime of theft is not a lesser included offense of burglary. Theft is neither a lesser degree of burglary nor a crime necessarily proved upon proof of burglary.[4]
Admittedly, defendant and his counsel at that time made no objection to the jurisdiction as the following exchange among court, counsel, and defendant at the arraignment makes clear:
"MR. PLATTNER [county attorney]: Your Honor, at this time the State of Minnesota would like to move this Court to change the crime from burglary which is M.S.A. 609.58 Subd. 2, Subs. 3 to M. S.A. 609.52, Subd. 2, Subs. 4Subs. 3Subs. 4, which constitutes the crime theft and is punishable by a term of imprisonment of 0 to 5 years.
"THE COURT: I understand this is done because of some talk between counsel *387 and some agreement on the part of the defendant?
"MR. SPOONER [defendant's counsel]: That is correct, your Honor; the defense has no objection to it.
"THE COURT: Very well; your plea of not guilty to the crime of burglary on which you have been arraigned is hereby annulled, voided and set aside and may I see the statute? I understand, Mr. Minton, that you are willing to plea to a lesser or rather a different crime which is included in the information filed, that of theft?
"DEFENDANT: Yes, sir.
"THE COURT: You understand this crime of theft being that you have taken property of Ross Gildow in the amount of more than $100.00?

"DEFENDANT: Yes, sir.
"THE COURT: In value, and that this too is punishable by imprisonment at not more than five years or by a fine of not more than $5,000 or both?
"DEFENDANT: Yes, sir.
"THE COURT: Very well; you understand that you are now charged with the included offense, that of theft of property in excess of $100 in value from one Ross Gildow, committed on or about the 16th day of May in the year 1965 in Cass County here?
"DEFENDANT: Yes, sir.
"THE COURT: You understand that charge?
"DEFENDANT: Yes, sir.
"THE COURT: And what is your plea to that charge?
"DEFENDANT: Guilty, your Honor.
"THE COURT: Before I can accept that plea of guilty, I would like to know if this is done with your approval, Mr. Spooner?
"MR. SPOONER: Yes, it is, your Honor.
"DEFENDANT: Yes." (Italics supplied.)
Furthermore, it was defendant himself who was the prime mover in arranging for the change in the charge as his court-appointed counsel later testified in a hearing upon defendant's subsequent motion in arrest of judgment.[5] Nevertheless, it is firmly established that jurisdiction over the subject matter cannot be conferred by consent and that a sentence pronounced by a court which lacks jurisdiction of the subject matter is wholly void.[6]
2. Defendant was denied substantial due process by the imposition of an excessive sentence because the offense to which he pleaded guilty was a misdemeanor and not a felony. He was sentenced to an indeterminate sentence for a felony although on this record the crime to which he pleaded guilty could only be a misdemeanor. Under the new Criminal Code the gravity of the crime of theft depends primarily upon the value of the property taken.[7] The critical question, then, related to the value of the roto-tiller admittedly stolen by defendant. If the roto-tiller had a value of less than $100, the crime could only be a misdemeanor. From the transcript of the preliminary hearing in municipal court at Walker, Minnesota, it appears that the owner himself fixed the value of the roto-tiller as being only "approximately $90." Defendant admittedly stole Gildow's fish poles too, but he was not charged with such theft and there was no evidence whatever as to their value.
*388 At the time of sentencing defendant made timely protest to the court in the following colloquy:
"THE COURT: * * * [I]s there anything you wish to say before sentence is pronounced?
"DEFENDANT: Yes, sir; I want you to know that this is a pretty serious crime for what I didI mean the charge that is against me. I feel that it is a pretty serious crime for it actuallyit carried a lot more time thanI mean it is right on the border between a misdemeanor and a felony. The roto-tillers cost $90.00, I believe that was its cost two years prior.
"THE COURT: Where was this taken from?
"DEFENDANT: It was taken from a garage in Pine River.
"THE COURT: That is entering a building, you see. We don't make the laws. I might disagree with you and I might agree with you wholeheartedly. It would make no difference to you or to me.
* * * * * *
"THE COURT: * * * It would seem to the Court that just seeing an open door is not an invitation to go in and take a roto-tiller and fishing poles and things that you see inside that door.
* * * * * *
"THE COURT: Punishment for this crime of theft for property takenwhere property taken is more than $100.00 and not more than $2,500.00 is by imprisonment in the state penitentiary for not more than five years or the payment of a fine of not more than $5,000.00. This is set out in 609.52, Subd. 3, Subs. 2, as has already been explained to you at the time that you plead guilty to this offense."
The denial of due process was undoubtedly inadvertent and perhaps as much the fault of defendant as it was of the court, particularly at the time of arraignment. Neither defendant nor his counsel so far as appears from the record called to the court's attention the testimony of Gildow previously taken in municipal court. It is possible that defendant himself had forgotten it at that point, but equally possible that he assumed that the court was aware of it notwithstanding the court's reference to value as being in excess of $100.
There is no doubt that defendant wanted to have the matter treated as a misdemeanor, although his court-appointed counsel states that he "was aware, having told him several times, that this was not a misdemeanor."[8] Even so, defendant could have believed otherwise at the point of actual plea, being misled by the court's reference to the new charge as being a "lesser crime." We do not need to decide the issue on that ground, however, because it is beyond doubt that defendant was, on this record, erroneously sentenced. He could not be sentenced for burglary because he was not tried or convicted for burglary. He could not be sentenced for theft as a felony because the offense to which he pleaded guilty was no more than a misdemeanor. Under the statute the maximum sentence for theft of property of $100 or less is imprisonment for not more than 90 days or a fine of not more than $100.
Due process required in this case that defendant be sentenced on the basis of the facts known, or which should have been known from the record in the case, at the time of sentencing. He should not have been sentenced on the basis of the crime to which he had previously pleaded guilty, whether the plea was made inadvertently or not. Although ordinarily it would not have been an abuse of the trial court's discretion to discredit the belated and otherwise *389 self-serving claim of value, if made only by defendant himself,[9] the unimpeached evidence of Gildow himself, being the only competent evidence, left no room for judicial discretion. It was incumbent upon defendant's counsel, or the trial court itself, to act consistently therewith to avoid the jeopardy either of wrongful conviction[10] or excessive punishment.
Defendant's plea of guilty is vacated and the case is remanded to the district court for trial upon the original information, but with leave to the county attorney to dismiss the information if he sees fit. If defendant is tried on his plea of not guilty to the original information and is convicted, he shall be given credit on any sentence thereupon imposed for the time he was held in custody from the time of arrest to sentencing.[11]
Reversed and remanded with directions.

APPENDIX

"WILLIAM J. SPOONER,
being first duly sworn by the court to testify, testified as follows:
"Examination by Mr. Plattner:
"Q. Mr. Spooner, you were Donald Minton's attorney when he was charged pursuant to the crime of burglary, M.S.A. 609.58, Subd. 2, Subs. 3?
"A. That's correct.
"Q. And, do you remember a conversation which took place in the presence of the defendant, myself, out of the hearing of the District Court, whereby the defendant wanted to plead guilty to the crime of burglary?
"A. I do.
"Q. And, was that at the defendant's insistence that this happened?
"A. Yes.
"Q. And, this is with your knowledge and approval?
"A. And, advice, yes.
"Q. Can you recall the circumstances, why he wanted to plead guilty to the crime of theft rather than the crime of burglary, do you remember that?
"A. Not specifically, just some vague feeling he had that he was not guilty of burglary.
"THE COURT: But, he did acknowledge the fact that he was guilty of theft?
"MR. SPOONER: That he was guilty of theft.
"Q. (By Mr. Plattner) And, he asked the State of Minnesota to change the crime to theft, which carried the same penalty, zero to five years, [rather] than to the crime of burglary which was originally charged?
"A. There may be some dispute there in that as you recall on preliminary hearingwould you ask me that question again?
"Q. Do you remember himStrike that.
"A. If you are asking me what is in that record, that transcript is correct. I recall that.
"Q. And, he knew each term was zero to five years, for the burglary or for the *390 theft, do you remember? If you don't, it is not that important.
"A. I don't specifically recall. I would tell the court this though; the property taken was taken from a garage, not attached, but very adjacent to a dwelling house wherein the people resided. We did have some conversation relative to whether or not that appurtenant structure would be considered part of the dwelling and therefore increase the sentence to ten years. Now, it may be that he was under the impression that he did enter under those circumstances a dwelling. I explained to him, I am sure, that that was an open question and there was a possibility that it could be ten years. So, he may not have readily assumed that the sentence for each charge was five years.
"THE COURT: At any rate, with regardhe understood that the information was being amended to allege facts constituting theft, punishable by zero to five years.
"MR. SPOONER: That's right.
"MR. WEBER [defendant's attorney]: If I may inquire for just a minute, Your Honor.
"THE COURT: Yes.
"Examination by Mr. Weber:
"Q. Mr. Spooner, was there any discussion about a misdemeanor? Did he have any feeling that this was possibly a charge of a misdemeanor?
"A. He at all times wanted me to inquire of the County Attorney whether or not he would reduce this charge to a misdemeanor. I did so on several occasions, ask the County [Attorney] to do so and he refused on all occasions and all my conversations were conveyed to the defendant and he was aware, having told him several times, that this was not a misdemeanor; that was the thing he was seeking of me more than anything else to do, to get me to reduce this thing to a misdemeanor and I am sure he knew.
"MR. PLATTNER: I think he has got 28 convictions, so he is not exactly a newcomer. He realized at the time the difference between a misdemeanor and a felony and I remember Mr. Spooner did ask me three or four times whether I would consent to do this and I told him absolutely no, in view of the defendant's long record."[12]
NOTES
[1]  Minn.St. 609.58 provides: "Subdivision 1. For the purposes of this section:

* * * * *
"(2) `Building' includes a dwelling or other structure suitable for affording shelter for human beings or appurtenant to or connected with a structure so adapted * * *.
"Subd. 2. Whoever enters a building without the consent of the person in lawful possession, with intent to commit a crime therein, commits burglary and may be sentenced as follows:
* * * * *
"(3) In any other case, to imprisonment for not more than five years or to payment of a fine of not more than $5,000, or both, if the intent is to steal or commit a felony or gross misdemeanor or to imprisonment for not more than one year or to payment of a fine of not more than $1,000, or both, if the intent is to commit a misdemeanor." (Italics supplied.)
[2]  Section 609.52 provides: "Subdivision 1. In this section:

"(1) `Property' means all forms of tangible property, whether real or personal, without limitation * * *.
* * * * *
"(3) `Value' means the market value at the time of the theft, or if the market value cannot be ascertained, the cost of replacement of the property within a reasonable time after the theft. * * *
* * * * *
"Subd. 2. Whoever does any of following commits theft and may be sentenced as provided in subdivision 3:
"(1) Intentionally and without claim of right takes, uses, transfers, conceals or retains possession of movable property of another without his consent and with intent to deprive the owner permanently of possession of the property; * * *
* * * * *
"(4) By swindling, whether by artifice, trick, device, or any other means, obtains property from another person; * * *
* * * * *
"Subd. 3. Whoever commits theft may be sentenced as follows:
"(1) To imprisonment for not more than ten years or to payment of a fine of not more than $10,000, or both, if the value of the property or services stolen exceeds $2,500; or
"(2) To imprisonment for not more than five years or to payment of a fine of not more than $5,000, or both, if the value of the property or services is more than $100 but not more than $2,500; * * *
* * * * *
"(4) In all other cases where the value of the property or services is $100 or less, to imprisonment for not more than 90 days or to payment of a fine of not more than $100, * * *."
[3]  State v. Oksanen, Minn., 149 N.W.2d 27; State ex rel. Isle v. Tahash, 260 Minn. 156, 109 N.W.2d 54, certiorari denied, 368 U.S. 906, 82 S.Ct. 188, 7 L.Ed.2d 101.
[4]  Section 609.585 expressly provides: "A prosecution for or conviction of the crime of burglary is not a bar to conviction of any other crime committed on entering or while in the building entered." See, also, State v. Hackett, 47 Minn. 425, 50 N.W. 472; State v. Robinson, 262 Minn. 79, 114 N.W.2d 737, certiorari denied, 371 U.S. 815, 83 S.Ct. 26, 9 L.Ed.2d 56; State v. Thompson, 241 Minn. 59, 62 N.W.2d 512.
[5]  See testimony of William J. Spooner set out as an appendix to this opinion.
[6]  State ex rel. Farrington v. Rigg, 259 Minn. 483, 485, 107 N.W.2d 841, 842.
[7]  See, Advisory Committee Comment, 40 M.S.A. p. 450.
[8]  See appendix to this opinion. Defendant's court-appointed counsel was, of course, himself in error.
[9]  See, State v. Roggenbuck, 271 Minn. 557, 136 N.W.2d 857; State ex rel. Crippen v. Rigg, 256 Minn. 41, 96 N.W.2d 875.
[10]  See, State v. Jones, 267 Minn. 421, 127 N.W.2d 153.
[11]  See, § 609.145.

State v. Youngren, 275 Minn. 388, 147 N.W.2d 370, is not applicable to the instant case inasmuch as the prosecution for theft rather than burglary was primarily at the instance of the defendant, rather than upon the initiative of the state because of substantial misgiving as to the propriety of prosecuting upon the burglary charge.
[12]  The record before us indicates that 12 of the mentioned offenses were traffic violations and several others were charges without any disposition. But at least 2 others involved offense of serious criminal nature.
