
2 Cal.App.4th 589 (1992)
3 Cal. Rptr.2d 563
THE PEOPLE, Plaintiff and Respondent,
v.
RICKY WATKINS, Defendant and Appellant.
Docket No. F015448.
Court of Appeals of California, Fifth District.
January 8, 1992.
*591 COUNSEL
Handy Horiye, under appointment by the Court of Appeal, for Defendant and Appellant.
Daniel E. Lungren, Attorney General, George Williamson, Chief Assistant Attorney General, Robert R. Anderson, Acting Assistant Attorney General, W. Scott Thorpe and Edgar A. Kerry, Deputy Attorneys General, for Plaintiff and Respondent.
[Opinion certified for partial publication.[*]]
OPINION
DIBIASO, J.
We will affirm the judgment and in part hold that the defense of mistake of fact does not apply to the allegation of an enhancement under Penal Code[1] section 12022.1.
The facts in this case need only be briefly stated. On December 14, 1989, defendant shoplifted two cartons of cigarettes from a Bakersfield supermarket. On September 22, 1990, he stole merchandise from a Bakersfield drugstore.
Defendant was charged in two separate actions with committing a petty theft. The information in each action alleged he had suffered five prior convictions (§ 666) and served four prior prison terms (§ 667.5, subd. (b)). The information regarding the September 1990 theft also alleged that at the time defendant committed the offense he was released from custody for the December 1989 theft (§ 12022.1).
The cases were subsequently consolidated. Defendant admitted two prior section 666 convictions and the court dismissed the others on the district attorney's motion. Defendant further admitted the four section 667.5, subdivision (b) enhancement allegations.
*592 The jury thereafter found defendant guilty of both charges.

DISCUSSION

I. MOTION TO SUPPRESS[*]
.... .... .... .... .... .... .... .

II. SECTION 12022.1 ENHANCEMENT
After a bifurcated court trial, the trial judge found the section 12022.1 allegation[4] to be true. The judge also expressly found that defendant reasonably believed the earlier case was no longer pending. Nevertheless, the court imposed the punishment for the enhancement on the ground section 12022.1 did not include a specific intent or state of mind element. It is obvious from *593 the trial judge's comments he concluded a mistake-of-fact defense is unavailable as a matter of law when the violation in issue does not involve some type of mental element.
(1a) Defendant asks us to reverse and vacate the enhancement. According to him, his mistake of fact constituted a complete defense to the enhancement allegation. Three subcontentions underlie this position: (1) the defense of mistake of fact applies as much to an enhancement as it does to a crime; (2) the defense may apply to enhancements without a mental element, such as section 12022.1; and (3) to reject the defense does not serve the purposes of section 12022.1.
We will not delve into whether mistake of fact generally applies to enhancements or whether it turns upon the presence of a mental element. Even if we resolved these points in defendant's favor, we would still hold the defense is irrelevant to section 12022.1.
(2a) The purpose behind section 12022.1 is to discourage a certain type of recidivist behavior. "The legislative intent of section 12022.1 was to punish recidivists with additional penalties." (People v. Warriner (1988) 200 Cal. App.3d 1352, 1356 [247 Cal. Rptr. 197]; see also People v. Lewis (1986) 185 Cal. App.3d 923, 927 [230 Cal. Rptr. 115].) Thus, section 12022.1 seeks to deter the commission of new felonies by persons released from custody on an earlier felony. (People v. Rodrigue (1986) 187 Cal. App.3d 828, 832 [232 Cal. Rptr. 187]; People v. Lewis, supra, 185 Cal. App.3d at p. 927; People v. Superior Court (Price) (1984) 150 Cal. App.3d 486, 489 [198 Cal. Rptr. 61].)
Under the express terms of the statute, imposition of the enhancement is conditioned upon valid convictions on both the first and second offenses. If the person is acquitted of the primary offense, imposition of the enhancement is permanently stayed. (§ 12022.1, subd. (d).) (3) If the conviction on the primary offense is reversed on appeal, the punishment for the enhancement must be suspended pending retrial of that felony. (§ 12022.1, subd. (g).) Inherent in subdivision (g) is the implied condition that if the defendant is not retried on the primary offense, the punishment for the enhancement may not be imposed. If the conditions concerning the first offense are satisfied, the additional penalty is imposed only if the defendant is convicted of the second offense. These statutory provisions make clear that the punishment prescribed in section 12022.1 is based upon the defendant's status as a repeat offender. (People v. Warriner, supra, 200 Cal. App.3d at p. 1356.)
(1b) We find nothing in section 12022.1 which suggests defendant should be excused from suffering the designated penalty because he believed *594 the first action was not pending when he committed the second crime. The defendant's honest impression the first action was closed does not eliminate the fact he was convicted of two crimes within the conditions set forth in the section. If the statute was primarily calculated to advance the different purpose of ensuring a defendant's compliance with the conditions of his or her release, it likely would have been written to permit the imposition of punishment in the absence of a valid conviction for the first offense.
We recognize that in People v. Melchor (1989) 211 Cal. App.3d 1485, 1489 [260 Cal. Rptr. 174], the court said section 12022.1 "reflects [the defendant's] breach of the terms of his special custodial status...." However, none of the cases (People v. Levell (1988) 201 Cal. App.3d 749, 752-753 [247 Cal. Rptr. 489]; People v. Warriner, supra, 200 Cal. App.3d at p. 1356; and People v. Jerome (1984) 160 Cal. App.3d 1087, 1098-1099 [207 Cal. Rptr. 199]) cited by Melchor for this proposition support it.
Furthermore, the defense itself is conceptually at odds with the facts of this case. (4) To determine whether a mistake of fact applies we must assume the facts were as the defendant perceived them. (People v. Scott (1983) 146 Cal. App.3d 823, 831 [194 Cal. Rptr. 633]; People v. Osborne (1978) 77 Cal. App.3d 472, 479 [143 Cal. Rptr. 582].) If under this assumed state of facts the defendant's actions would not have constituted a crime, the defense applies. (People v. Lucero (1988) 203 Cal. App.3d 1011, 1016 [250 Cal. Rptr. 354]; People v. Scott, supra, at p. 831.) Conversely, if under this assumed state of facts the defendant's actions would still have been unlawful, the defense does not apply. (People v. Osborne, supra, at p. 479.)
Here, defendant cannot legitimately argue the September 1990 theft was not a crime because he believed the prior charge was no longer pending. (1c), (5) (See fn. 5.) His acts on the second occasion, as found by the jury, were culpable regardless of the status of the earlier proceedings.[5]
Defendant is really saying he would not have committed the second offense if he knew the first proceeding had not been resolved. However, had he not committed the second offense he would not have been subject to any punishment for it or for the enhancement provided by section 12022.1. We thus fail to see how the statutory purpose is defeated if the defense of mistake of fact is rejected. (2b) Defendant claims the statute does not deter when the accused believes he or she is not subject to the terms of the *595 former release. To the contrary, the statute deters most effectively when liability for its violation is strict, and when punishment is imposed without regard to the defendant's subjective belief.

DISPOSITION
The judgment is affirmed.
Ardaiz, Acting P.J., and Thaxter, J., concurred.
Appellant's petition for review by the Supreme Court was denied March 26, 1992. Mosk, J., was of the opinion that the petition should be granted.
NOTES
[*]   Pursuant to California Rules of Court, rule 976.1, this opinion is certified for publication with the exception of part I.
[1]  All statutory references are to the Penal Code unless otherwise indicated.
[*]   See footnote, ante, page 589.
[4]  Section 12022.1 provides:

"(a) For the purposes of this section only:
"(1) `Primary offense' means a felony offense for which a person has been released from custody on bail or on his or her own recognizance prior to the judgment becoming final, including the disposition of any appeal, or for which release on bail or his or her own recognizance has been revoked.
"(2) `Secondary offense' means a felony offense alleged to have been committed while the person is released from custody for a primary offense.
"(b) Any person arrested for a secondary offense which was alleged to have been committed while that person was released from custody on a primary offense shall be subject to a penalty enhancement of an additional two years in state prison which shall be served consecutive to any other term imposed by the court.
"(c) The enhancement allegation provided in subdivision (b) shall be pleaded in the information or indictment which alleges the secondary offense and shall be proved as provided by law. The enhancement allegation may be pleaded in a complaint but need not be proved at the preliminary hearing for the secondary offense.
"(d) Whenever there is a conviction for the secondary offense and the enhancement is proved, and the person is sentenced on the secondary offense prior to the conviction of the primary offense, the imposition of the enhancement shall be stayed pending imposition of the sentence for the primary offense. The stay shall be lifted by the court hearing the primary offense at the time of sentencing for that offense and shall be recorded in the abstract of judgment. If the person is acquitted of the primary offense the stay shall be permanent.
"(e) If the person is convicted of a felony for the primary offense, is sentenced to state prison for the primary offense, and is convicted of a felony for the secondary offense, any state prison sentence for the secondary offense shall be consecutive to the primary sentence.
"(f) If the person is convicted of a felony for the primary offense, is granted probation for the primary offense, and is convicted of a felony for the secondary offense, any state prison sentence for the secondary offense shall be enhanced as provided in subdivision (b).
"(g) If the primary offense conviction is reversed on appeal, the enhancement shall be suspended pending retrial of that felony. Upon retrial and reconviction, the enhancement shall be reimposed. If the person is no longer in custody for the secondary offense upon reconviction of the primary offense, the court may, at its discretion, reimpose the enhancement and order him or her recommitted to custody."
[5]  Defendant's reasonable belief would clearly constitute a defense had he been charged with failing to appear under section 1320, subdivision (b) (release on own recognizance) or section 1320.5 (bail), since both crimes require proof of the specific mental element of wilfulness. (See People v. Wesley (1988) 198 Cal. App.3d 519, 524 [243 Cal. Rptr. 785].)
