delivered the opinion of the court;
Defendant appeals her conviction of the offense of theft (less than $150) under section 16 — 1(a) of the Criminal Code of 1961 (Ill. Rev. Stat. 1979, ch. 38, par. 16 — 1(a)) and the sentence of 3 years imposed by reason of the provisions of section 16 — 1(e) of that Code (Ill. Rev. Stat. 1979, ch. 38, par. 16 — 1(e)), which provides:
“(1) Theft of property, other than a firearm, not from the person and not exceeding $150 in value is a Class A misdemeanor. A second or subsequent offense after a conviction of any type of theft, including retail theft, other than theft of a firearm, is a Class 4 felony.”
Prior to trial each party stipulated to the fact that the defendant had a prior conviction for retail theft. The prosecution agreed to refrain from introducing evidence of the prior conviction in its case in chief, but qualified the agreement by informing the trial court that a conviction of defendant would be a Class 4 felony under the cited section of the Criminal Code of 1961. The stipulation regarding the prior theft conviction was entered outside of the presence of the jury, and the jury was never informed of its content. The jury instructions contain no mention of the prior conviction, and the general verdict form made no express finding that defendant had committed the misdemeanor theft and also possessed a prior theft conviction.
The jury found defendant guilty of the misdemeanor offense of retail theft. The defendant raises a single issue on appeal, claiming that her sentence must be vacated because her prior theft conviction was not presented to the jury.
In People v. Ostrand (1966), 35 Ill. 2d 520, 221 N.E.2d 499, defendant was charged with the unlawful use of weapons, a misdemeanor, in violation of section 24 — 1(a)(4) of the Criminal Code of 1961 (Ill. Rev. Stat. 1961, ch, 38, par. 24 — 1(a)(4)). He contended that it was error to permit the prosecution to allege and prove that he had been convicted of a felony within 5 years. Such prior conviction elevated the misdemeanor charge to a felony under the Criminal Code. It was there argued that the prior conviction was not an element of the offense of unlawful use of weapons. The court stated:
“However, violation of section 24 — 1(a)(4), in the absence of a prior felony conviction within 5 years is a misdemeanor, while violation of that same section after having been convicted of a felony within the previous 5 years constitutes a felony (sec. 24 — 1(b)) as misdemeanor and felony are defined in the Criminal Code of 1961 (Ill. Rev. Stat. 1961, chap. 38, pars. 2 — 11, 2 — 7). Under such circumstances, it was not only proper to allow the allegation and proof of a prior felony conviction, but it was necessary in order to prove defendant’s commission of the felony of carrying a concealed weapon. (Cf. People v. Booker, 34 Ill. 2d 16, 17, 213 N.E.2d 542.)” (Emphasis added.) 35 Ill. 520, 529, 221 N.E.2d 499, 505.
In People v. Edwards (1976), 63 Ill. 2d 134, 345 N.E.2d 496, defendant was charged with unlawful use of weapons as a felony in violation of section 24 — 1(b) of the Criminal Code of 1961 (El. Rev. Stat. 1973, ch. 38, par. 24 — 1(b)). A stipulation was presented to the jury to the effect that defendant had been convicted of a felony within the statute. No instruction was given to the jury concerning the elements of the offense of unlawful use of weapons within the felony provision, and the jury was instructed that such prior conviction could only be considered in measuring the credibility of defendant as a witness. The opinion reversed the conviction as a felony upon the determination that upon the instructions given, the jury could not have determined that all of the elements of the felony offense were proved. Considering the nature of the instructions given, the court stated:
“We must conclude that the jury did not find the defendant guilty of felonious unlawful use of a weapon, and it was error for a judgment of conviction of that offense to be entered.” 63 Ill. 2d 134, 140-41, 345 N.E.2d 496, 499.
In People ex rel. Carey v. Pincham (1979), 76 Ill. 2d 478, 394 N.E.2d 1043, defendant was charged with unlawful use of weapons after having been convicted of a felony. Defendant objected to the jury being advised of the prior conviction and offered to stipulate to such. The trial judge ordered a bifurcated trial upon the issue of unlawful possession, and if found guilty, then upon the issue of a prior conviction of a felony. In mandamus proceedings, the supreme court vacated the order for the reason that:
“The decisions of this court have established that proof of the prior conviction is necessary to a conviction on the felony charge. (People v. Edwards (1976), 63 Ill. 2d 134; People v. Ostrand (1966), 35 Ill. 2d 520.) These decisions have been followed by the appellate court, and in People v. Crawford (1978), 59 Ill. App. 3d 211, the court held that where proof before the jury established only possession of a weapon, the conviction was for a misdemeanor only in spite of a stipulation out of the presence of the jury as to the defendant’s prior conviction and incarceration. That court held that proof of the aggravating circumstances must come before the finding of guilt or innocence, which is consistent with the decisions of this court.” 76 Ill. 2d 478, 480, 394 N.E.2d 1043, 1044.
In People v. Langdon (1979), 73 Ill. App. 3d 881, 392 N.E.2d 142, the opinion noted, amongst other things, that any stipulation concerning a prior conviction must be presented to the jury where the effect of a statute is to elevate a misdemeanor to a felony.
The rationale of Ostrand and Edwards is explicated in People v. Racinowski (1979), 78 Ill. App. 3d 954, 397 N.E.2d 932, People v. Grier (1980), 90 Ill. App. 3d 840, 413 N.E.2d 1316, and People v. Turner (1981), 93 Ill. App. 3d 61, 416 N.E.2d 1149. In each the issue was whether defendant could be sentenced under sections 5 — 5—3.1 and 5 — 8—2 of the Unified Code of Corrections (Ill. Rev. Stat. 1979, ch. 38, pars. 1005 — 5—3.1, 1005 — 8—2) to an extended term where the previous conviction of a felony had not been alleged and proved. In confirming a sentence for escape as an extended term, the opinion in Racinowski stated:
“Where a criminal statute specifically provides that a previous conviction mandates enhancing the sentence or raising the degree of the offense, such previous conviction must be alleged in the indictment and proven to the fact finder. [Citations.] All of these statutes either specifically raise the classification of the crime for a second offense or specifically raise the penalty range to be applied to a second offense. The penalties so provided are not discretionary with the judge. Therefore, under any of them, a prior conviction becomes- an element of the offense charged, and must be alleged in the indictment or information.” 78 Ill. App. 3d 954, 960-61, 397 N.E.2d 932, 937.
In Grier, where an extended term was imposed for robbery, the opinion noted that imposition of an extended term under the statute was discretionary, and the court stated:
“As is apparent from a reading of the opinion in Ostrand, proof of a prior felony conviction changes the offense of unlawful use of weapons from a misdemeanor to a felony. Without such proof, conviction of unlawful use of weapons may be punished only as a misdemeanor. Under the Unified Code of Corrections, the presence of aggravating factors does not change the class of offense. People v. Ramey (1974), 22 Ill. App. 3d 916, 317 N.E.2d 143, also cited by defendant, is similarly distinguishable in that the existence of a prior theft conviction changes the class of the offense from a misdemeanor to a felony. As the State correctly indicates, the authorities which have considered the very question raised by defendant’s argument have answered it contrary to his present position.” 90 Ill. App. 3d 840, 855, 413 N.E.2d 1316, 1327.
The same distinction is noted in Turner and People v. Hayes (1980), 90 Ill. App. 3d 102, 412 N.E.2d 1109, appeal allowed (1981), 83 Ill. 2d 572.
Within the rationale of the cited cases, it is apparent that section 16 — 1(e) of the Criminal Code of 1961 provides that a misdemeanor shall be raised to a Class 4 felony, and that upon such change of classification of the offense, an allegation and proof of the prior conviction becomes an element of the offense. The cited statutory provisions mandate a sentence as a felony, and the trial court has no discretion as to the classification of the offense.
The prosecution argues that the defendant should not be permitted to assign error upon those matters and things which she invited or requested. It cites People v. Savage (1968), 102 Ill. App. 2d 88, 243 N.E.2d 702, where evidence of defendant’s prior conviction was not introduced before the jury, but only at the sentence hearing in aggravation and mitigation. Such opinion, however, has not been followed upon the issues raised, and we note that in Edwards the reversal of the conviction as a felony was reversed by the supreme court upon its sua sponte determination that the jury had neither been instructed nor had it returned a verdict upon a finding of the prior conviction.
Upon the authorities cited, it was the duty of the prosecution to protect its record, and the agreement to the stipulation entered reflects its failure to do so. For such reason, we must hold that defendant was not proved guilty of the theft as a felony.
The conviction and sentence for felony theft is reversed; the conviction of defendant for misdemeanor theft is affirmed, and the cause is remanded for imposition of a proper sentence. Edwards.
Reversed in part, affirmed in part, and remanded with directions.
MILLS and LONDRIGAN, JJ., concur.