
6 Cal.4th 367 (1993)
862 P.2d 739
24 Cal. Rptr.2d 739
THE PEOPLE, Plaintiff and Respondent,
v.
GREGORY McCLELLAN, Defendant and Appellant.
Docket No. S028225.
Supreme Court of California.
December 2, 1993.
*369 COUNSEL
Florence V. Hoffman, under appointment by the Supreme Court, and Thomas W. Condit, 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, Assistant Attorney General, Edgar A. Kerry, Rosendo Pena, Jr., and Louis M. Vasquez, Deputy Attorneys General, for Plaintiff and Respondent.
OPINION
GEORGE, J.
This case presents a question closely related to the issue involved in In re Moser, ante, page 342 [24 Cal. Rptr.2d 723, 862 P.2d 723]. *370 In Moser, a criminal defendant who, pursuant to a plea agreement, pleaded guilty to second degree murder, sought to have his conviction set aside on habeas corpus on the ground that the trial court, in advising him of the direct consequences of his proposed plea, erroneously advised him concerning the length of his potential term of parole. In the present case, a defendant who, pursuant to a plea agreement, pleaded guilty to assault with intent to commit rape, seeks to have his guilty plea set aside on appeal on the ground that the trial court, in advising him prior to the entry of the plea, failed to inform him that upon conviction of this offense he would be required to register as a sex offender pursuant to Penal Code section 290.[1]
As we explained in Moser, "a defendant who has pleaded guilty after receiving inadequate or erroneous advice from the trial court with regard to the potential consequences of a plea generally is entitled to obtain relief only by establishing that he or she was prejudiced by the erroneous advice, i.e., by establishing ... that but for the trial court's erroneous advice ..., the defendant would not have entered the guilty plea." (Moser, supra, ante, at p. 345.) In the present case, because the record on appeal fails to establish that defendant would not have entered his guilty plea had he been advised of the mandatory sex offender registration requirement, and also fails to establish that imposition of the registration requirement violates the terms of defendant's plea agreement, we conclude that the Court of Appeal erred in holding that defendant was entitled to relief, and therefore reverse the judgment of the Court of Appeal.

I. FACTUAL AND PROCEDURAL BACKGROUND
On May 12, 1990, Bakersfield police officers responded to a request for assistance concerning an injured minor, Donna T., who was 16 years of age. The police subsequently learned that the minor had been attacked in the bathroom of a friend's residence, that a man of defendant's description had been observed in the vicinity of the crime, and that defendant's fingerprints were found at the scene.
In July 1990, police officers contacted defendant at the Kern County jail, where he was in custody following his arrest on unrelated charges. He was placed under arrest in connection with the assault on Donna T., and subsequently was charged by information as follows: count I  assault with intent to commit rape (§§ 220, 261, subd. (a)(2)); count II  attempted rape (§§ 261, subd. (a)(2), 664) with the intentional infliction of great bodily injury (§ 1203.075); count III  burglary (§§ 459, 460); and count IV  battery resulting in serious bodily injury (§ 243, subd. (d)). The information *371 also alleged that defendant previously had been convicted of a serious felony (§ 667, subd. (a)), had served a prior prison term (§ 667.5, subd. (b)), and (as to counts I, II, and III) had inflicted great bodily injury (§ 12022.7).
Following the preliminary hearing, defendant was held to answer on the above charges, thereafter entering a plea of not guilty and denying the additional allegations.
In September 1990, defendant withdrew his plea of not guilty and entered a plea of guilty to count I, assault with intent to commit rape, also admitting the allegations of intentional infliction of great bodily injury, prior serious felony conviction, and prior service of a prison term. Defendant's guilty plea specifically was conditioned upon dismissal of the attempted rape, burglary, and battery charges and imposition of a state prison sentence not to exceed thirteen years (based upon a middle term sentence of four years for the assault with intent to commit rape (§ 220), a consecutive three-year enhancement for the great bodily injury allegation (§ 12022.7), a consecutive five-year enhancement for the prior serious felony allegation (§ 667, subd. (a)), and a consecutive one-year enhancement for the prior prison term allegation (§ 667.5, subd. (b)).[2]
Because it was conditioned upon a sentence not to exceed 13 years and dismissal of the attempted rape, burglary, and battery charges, the plea offered substantial benefits to defendant.
Prior to accepting defendant's guilty plea, the trial court fully and accurately advised defendant of his constitutional rights. The court also accurately advised defendant as to the length of the parole term he would face *372 following his release from prison, but failed, however, to advise defendant that his plea of guilty to the offense of assault with intent to commit rape would require that he register as a sex offender pursuant to section 290.[3]
The trial court inquired whether defendant's plea was freely and voluntarily made and whether there was a factual basis for the plea pursuant to section 1192.5 (but improperly failed to advise defendant of his right to withdraw the plea in the event the trial court at the time of sentencing withdrew its approval of the terms of the plea agreement). (§ 1192.5.)[4] The court also inquired of defendant whether anyone had promised him anything other than the stated terms of the plea agreement, to which defendant responded in the negative.
Upon the trial court's acceptance of the plea, the People, pursuant to the terms of the plea agreement, moved to dismiss the attempted rape, burglary, and battery charges, conditioned upon the plea remaining in effect.
In October 1990, the probation officer filed her report recommending that probation be denied, that defendant be sentenced to a prison term totaling 15 years (including the 6-year upper term for the assault, plus enhancements), and that defendant be required to register as a sex offender pursuant to section 290.
At the sentencing hearing conducted 11 days later, the trial court, having reviewed the probation officer's report and defendant's prior criminal record, observed that "[t]he [sentencing] choice... in this case ... is between the [four-year] mid[dle] term (described at the change of plea hearing) and the [six-year] upper term" (recommended by the probation officer) for defendant's assault with intent to commit rape. "The low term is *373 not a viable alternative based on the facts and circumstances of this case as well as the circumstances obviously in aggravation that have been cited.... [¶] The Court feels that under the circumstances, however, that the plea bargain is appropriate and the middle term with the enhancements for the prior convictions is an appropriate sentence in that regard. [¶] And that's what the Court is going to do."
Prior to imposing sentence, the trial court invited defense counsel to comment. Although defense counsel raised specific challenges to other aspects of the probation officer's report, she did not challenge the recommendation set forth in the probation officer's report that defendant be required to register as a sex offender. After sentencing defendant to a prison term totaling 13 years, the trial court declared, "The defendant is also instructed to register as required under the provisions of Section 290 of the Penal Code." Defendant did not interpose an objection to the registration requirement, nor did he request permission to withdraw his plea of guilty in the event the registration requirement were to be imposed.
Defendant filed a timely notice of appeal in propria persona, citing numerous grounds pertaining to his initial detention and arrest, and again failing to challenge the registration requirement imposed at sentencing.[5] Six months after filing his notice of appeal, defendant filed in the Court of Appeal an "Application to Amend Notice of Appeal" which added, as a basis for the appeal, the trial court's imposition of the sex offender registration requirement. In this amended notice, defendant asserted that, had he been advised of the registration requirement, he would not have entered his plea of guilty. The Court of Appeal, in granting the application to amend the notice of appeal, cited rule 41(c) of the California Rules of Court ("... Failure of the adverse party to serve and file written opposition ... may be deemed a consent to the granting of [the] motion."). In his briefing in the Court of Appeal, defendant contended that the judgment should be reversed because the trial court failed to advise him at the change of plea hearing that registration as a sex offender was a direct consequence of his guilty plea. The People argued in response that the trial court's error was harmless.
Characterizing the trial court's error as a "violation of a plea bargain," the Court of Appeal distinguished our decision in People v. Walker (1991) 54 *374 Cal.3d 1013 [1 Cal. Rptr.2d 902, 819 P.2d 861], holding that because the registration requirement does not lend itself to a remedy of substantial specific performance as was fashioned with regard to the challenged restitution fine in Walker, the defendant in the present case must be given the opportunity to withdraw his plea. The Court of Appeal therefore remanded the case to the trial court to allow defendant to reaffirm the plea agreement, including the sex offender registration requirement, or, alternatively, to withdraw his plea. The People sought review in this court, urging that the proper remedy was to remand the matter to the trial court for the purpose of reopening plea negotiations.

II. DISCUSSION
As in Moser, supra, ante, at page 342, we are asked in the present case to determine what remedy, if any, should be afforded in view of the trial court's failure to provide the defendant with complete and accurate advice concerning the direct consequences of a guilty plea, prior to accepting the plea.
Defendant characterizes the trial court's error as a failure to advise him of the direct consequences of his plea. (See In re Birch (1973) 10 Cal.3d 314 [110 Cal. Rptr. 212, 515 P.2d 12] [judgment vacated where trial court failed to advise an unrepresented defendant of the sex offender registration requirement prior to accepting the defendant's plea of guilty to a charge of committing lewd or dissolute conduct].) Defendant also contends that, because the trial court's imposition of the sex offender registration requirement amounts to a lifetime punishment that was not included in the parties' plea agreement, it constitutes a violation of that agreement, entitling defendant to withdraw his plea. (See § 1192.5; People v. Walker, supra, 54 Cal.3d 1013, 1024 ["When a guilty plea is entered in exchange for specified benefits such as the dismissal of other counts ..., both parties, including the state, must abide by the terms of the agreement. The punishment may not significantly exceed that which the parties agreed upon."]; see also In re Reed (1983) 33 Cal.3d 914, 920-922 [191 Cal. Rptr. 658, 663 P.2d 216] [sex offender registration is punitive in nature].)[6]
The People concede defendant is entitled to obtain relief, but contend that allowing him to withdraw his plea improperly would ignore the constitutional interests of the victim (Cal. Const., art. I, § 28, subd. (a)) and that, in *375 view of these interests, notions of fairness and a balancing of interests demand that the People be afforded an opportunity to help shape the remedy in this case. Thus, the People urge remand of this case to the trial court to enable it, after additional briefing and argument, "to determine whether withdrawal of the plea, renegotiation, specific performance, or voluntary acceptance of the plea by defendant (with the addition of the registration requirement), would be the most appropriate remedy."
As explained below, we reject the remedy proposed by each party as inconsistent with our analysis in Moser. Although, unlike Moser, the present case reaches us on direct appeal rather than on habeas corpus, and involves failure to advise of a registration requirement rather than erroneous advice concerning the length of the applicable term of parole, both cases involve defendants who, following imposition of sentence, are attempting to set aside a consummated plea agreement, based upon a trial court's error in advising the defendant of certain consequences of a plea of guilty. In view of this similarity, our analysis in Moser is instructive.
"In analyzing the parties' contentions, we adhere to the framework set forth in our decision in People v. Walker, supra, 54 Cal.3d 1013, 1019-1020, where we explained that resolution of the issues presented `requires consideration of two related but distinct legal principles. (See People v. Glennon (1990) 225 Cal. App.3d 101, 104 [276 Cal. Rptr. 1].) [¶] (1) The first principle concerns the necessary advisements whenever a defendant pleads guilty, whether or not the guilty plea is part of the plea bargain. The defendant must be admonished of and waive his constitutional rights. (Boykin v. Alabama (1969) 395 U.S. 238 [23 L.Ed.2d 274, 89 S.Ct. 1709]; In re Tahl (1969) 1 Cal.3d 122 [81 Cal. Rptr. 577, 460 P.2d 449].) In addition, and pertinent to this case, the defendant must be advised of the direct consequences of the plea. (Bunnell v. Superior Court (1975) 13 Cal.3d 592, 605 [119 Cal. Rptr. 302, 531 P.2d 1086].) [¶] (2) The second principle is that the parties must adhere to the terms of a plea bargain. (People v. Mancheno (1982) 32 Cal.3d 855, 860 [187 Cal. Rptr. 441, 654 P.2d 211].) [¶] In any given case, there may be a violation of the advisement requirement, of the plea bargain, or of both. Although these possible violations are related, they must be analyzed separately, for the nature of the rights involved and the consequences of a violation differ substantially. Indeed, much of the confusion engendered by the appellate decisions on this issue results from a blurring of the distinction between these principles.'" (Moser, supra, ante, at pp. 350-351.)
Thus, we first consider whether the trial court's failure to advise defendant regarding the sex offender registration requirement constituted a violation of *376 the court's obligation to inform him of the direct consequences of his plea of guilty, and, if so, whether such a violation entitles him to the relief he now seeks. Thereafter, we consider the separate question whether imposition of the sex offender registration requirement constituted a violation of the parties' plea agreement.

A. Advisement of the consequences of the plea

(3a) Our initial inquiry, whether the trial court's failure to advise defendant of the sex offender registration requirement violated its obligation to inform him of the direct consequences of the plea, easily is answered. (4)(See fn. 7.) In Bunnell v. Superior Court (1975) 13 Cal.3d 592 [119 Cal. Rptr. 302, 531 P.2d 1086], we cited the registration requirement contained in section 290 as an example of the plea consequences of which a defendant must be informed. (Bunnell, supra, at p. 605 ["In all guilty plea and submission cases the defendant shall be advised of the direct consequences of conviction such as the permissible range of punishment provided by statute, registration requirements, if any (e.g., § 290 ...) ...."]; see also In re Birch, supra, 10 Cal.3d 314, 322 [registration requirement constitutes a "grave and direct consequence of [the defendant's] guilty plea; in the absence of counsel the responsibility for such advice rested with the court"].)[7] (3b) We therefore conclude that Bunnell error has occurred where the trial court fails to advise a defendant that, as a consequence of his or her plea of guilty to any one of the offenses enumerated in section 290, the defendant must register as a sex offender.[8]
Having found such error, we next must determine whether it entitles defendant to the relief he now seeks. Defendant claims that, in view of the *377 trial court's omission, he is entitled to withdraw his plea of guilty. For the reasons that follow, we reject defendant's contention.
In People v. Walker, supra, 54 Cal.3d 1013, we held that absent a timely objection, a defendant waives a claim of error as to a trial court's misadvisement concerning the consequences of a guilty plea. (5) "`The purpose of the general doctrine of waiver is to encourage a defendant to bring errors to the attention of the trial court, so that they may be corrected or avoided and a fair trial had.... [¶] In this case, the record reflects that defense counsel was familiar with the probation report. Had the recommendation that defendants be ordered to pay a restitution fine come as a genuine surprise, it would have been a simple matter to bring the issue to the attention of the trial court.'" (Id., at p. 1023, quoting People v. Melton (1990) 218 Cal. App.3d 1406, 1409 [267 Cal. Rptr. 640].)
(3c) Applied to the present case, Walker supports a determination that defendant waived his claim of error by failing at the sentencing hearing to interpose a timely objection to the registration requirement. Defendant's counsel was aware of the probation officer's report, filed 11 days prior to the sentencing hearing, recommending that defendant be ordered to register as a sex offender. In the context of her objections at the sentencing hearing to other matters contained in the probation officer's report, defense counsel readily could have challenged the registration recommendation. (See, e.g., People v. Walker, supra, 54 Cal.3d at p. 1030 ["whenever possible, any error in taking the plea should be brought to the attention of the court at sentencing so that it can be addressed expeditiously"]; see also People v. Victorian (1992) 2 Cal. App.4th 954, 957 [4 Cal. Rptr.2d 460] [judgment reversed where, prior to sentencing, defendant unsuccessfully moved to withdraw his guilty plea based upon the trial court's misadvisement as to the maximum length of his parole term].) Moreover, when the trial court formally imposed the registration requirement later in the sentencing hearing, the defense had a second opportunity to challenge it but failed to do so. Under these circumstances, we conclude defendant waived any claim of prejudice arising from the trial court's error. (Cf. Moser, supra, ante, at p. 352, fn. 8 [no waiver where trial court's imposition of sentence was not at variance with its erroneous advice at earlier proceeding, and nothing in the record suggested that defendant should have been aware of the trial court's error].)
Defendant contends, however, that under People v. Walker, supra, 54 Cal.3d 1013, his failure at the sentencing hearing to object to the imposition of the registration requirement should not operate as a waiver of the misadvisement error because the trial court, at the change of plea hearing, failed to *378 advise him, pursuant to section 1192.5, of his right to withdraw his plea in the event he was sentenced to a punishment more severe than that contemplated by the plea agreement. In Walker, however, we explained that a trial court's failure to provide a section 1192.5 admonition permits a defendant to complain of an asserted violation of the plea agreement despite the absence of any objection at the sentencing hearing. (54 Cal.3d at pp. 1024-1026.) We did not suggest that the trial court's failure to give the section 1192.5 advisement would excuse the defendant from objecting to the imposition of a direct consequence of the guilty plea, as to which he simply was not advised by the trial court at the plea proceedings. (54 Cal.3d at p. 1023.)
Furthermore, the record before us fails to establish that defendant was prejudiced by the trial court's failure to advise him of the registration requirement. Although defendant's amended notice of appeal contains an assertion by defendant that, but for the trial court's omission, he would not have pleaded guilty, that extrajudicial assertion is not a proper component of the record on appeal. Because the record of the trial court proceedings contains no evidence (nor even an assertion) concerning the bearing of a registration requirement upon defendant's decision to plead guilty, the prosecution never has had an opportunity to contest the assertion made by defendant on appeal, and the trial court had no occasion to pass upon the veracity of defendant's present claim. Indeed, to the extent the trial court record sheds any light upon the issue before us, defendant's failure to object at the sentencing hearing suggests that he did not consider the registration requirement significant in the context of his plea agreement.
As we reiterated in Moser, supra, ante, at page 352, "[A] defendant (even on direct appeal) is entitled to relief based upon a trial court's misadvisement only if the defendant establishes that he or she was prejudiced by the misadvisement, i.e., that the defendant would not have entered the plea of guilty had the trial court given a proper advisement." (Ibid., citing People v. Walker, supra, 54 Cal.3d at pp. 1022-1023; see also People v. McMillion (1992) 2 Cal. App.4th 1363, 1370 [3 Cal. Rptr.2d 821]; People v. Wagoner (1979) 89 Cal. App.3d 605, 611-612 [152 Cal. Rptr. 639].) Although defendant alleges that had he properly been advised, he would not have entered his plea of guilty, there is nothing in the record on appeal to support this contention. Thus, we conclude defendant has failed to meet his burden of establishing prejudice.

B. Violation of the plea agreement

(6) Defendant's failure to establish that he is entitled to relief, based upon the trial court's failure at the change of plea hearing to advise him of *379 the sex offender registration requirement, does not end our inquiry. As explained in Moser, we also must determine whether the trial court's error constitutes a violation of the parties' plea agreement, entitling defendant to some form of relief. (Moser, supra, ante, at p. 351.)[9] The relevant principles underlying the importance of such an inquiry are set forth in Moser (ante, at pp. 353-354) and need not be repeated here.
As explained above, prior to accepting defendant's plea of guilty, the trial court fully recited on the record the terms of the parties' plea agreement, observing that defendant had agreed to plead guilty to the charge of assault with intent to commit rape and admit the enhancement allegations, in exchange for the People's agreement to dismissal of the attempted rape, burglary, and battery charges and corresponding enhancements, and the imposition of a maximum state prison term of 13 years. (See fn. 2, ante, and accompanying text). When the trial court inquired of defense counsel, and of defendant personally, whether each of them understood the plea agreement to embrace the terms identified by the court, each responded affirmatively. The statutory requirement of sex offender registration was not mentioned by the parties or by the court at the change of plea hearing.
Unlike the petitioner in Moser, supra (see ante, p. 357), defendant does not suggest that the challenged element of his sentence was a subject of negotiation (or even discussion) during the plea-negotiation process, or that the prosecutor made any promises or inducements relevant to the challenged element. (Cf. Santobello v. New York (1971) 404 U.S. 257, 262 [30 L.Ed.2d 427, 433, 92 S.Ct. 495] ["[W]hen a plea rests in any significant degree on a promise or agreement of the prosecutor, so that it can be said to be part of the inducement or consideration, such promise must be fulfilled."].) Thus, we conclude that the trial court's omission, at the change of plea hearing, of advice regarding defendant's statutory obligation to register as a sex offender did not transform the court's error into a term of the parties' plea agreement.
Our decision in People v. Walker, supra, 54 Cal.3d 1013, is not helpful to defendant's argument. As we explained in Moser, supra (see ante, pp. 356-357): "In Walker, the offense to which the defendant had agreed to plead guilty carried a potential seven-year sentence and a $10,000 punitive fine, but under the negotiated plea agreement the defendant was to receive a five-year term of imprisonment and no punitive fine. At the subsequent *380 sentencing hearing, the trial court imposed the agreed-upon five-year sentence but also a substantial ($5,000) restitution fine. [¶] In concluding that the imposition of such a substantial fine constituted a violation of the plea agreement in Walker, we implicitly found that the defendant in that case reasonably could have understood the negotiated plea agreement to signify that no substantial fine would be imposed. Moreover, in reaching this conclusion, we reasoned that, because the amount of an appropriate restitution fine imposed upon a defendant could vary significantly depending upon the specific facts of a given case, `the restitution fine should generally be considered in plea negotiations.' (People v. Walker, supra, 54 Cal.3d at p. 1024.)"
By contrast, the sex offender registration requirement challenged in the present case is, like the parole term in Moser, a statutorily mandated element of punishment for the underlying offense. (§§ 290, 290.1; see also Barrows v. Municipal Court, supra, 1 Cal.3d at p. 825 [section 290 "applies automatically when a person is convicted of one of the enumerated offenses"]; People v. Saunders (1991) 232 Cal. App.3d 1592, 1597 [284 Cal. Rptr. 212] [where one is guilty of assault with intent to commit rape, registration is required "under the plain language of the statute"]; People v. Monroe, supra, 168 Cal. App.3d 1205, 1209 [section 290 "leaves no discretion in the trial judge to not require registration if one or more of the listed violations occurs"].) Thus, unlike the amount of a restitution fine, sex offender registration is not a permissible subject of plea agreement negotiation; neither the prosecution nor the sentencing court has the authority to alter the legislative mandate that a person convicted of assault with intent to commit rape shall register as a sex offender pursuant to the provisions set forth in section 290. Accordingly, Walker does not support defendant's claim.
The contrary conclusion reached by the dissenting opinion of Justice Mosk is based entirely upon its inaccurate characterization of the sex offender registration requirement as a punishment added "after the [plea] bargain was struck." (Dis. opn. of Mosk, J., post, at p. 382.) Because the registration requirement is statutorily mandated for every person convicted of assault with intent to commit rape, that requirement was an inherent incident of defendant's decision to plead guilty to that offense and was not added "after" the plea agreement was reached. The record does not suggest that the prosecution misled or deceived defendant; no promise or suggestion ever was made that the mandatory registration requirement would not be imposed.
As we have explained above, the trial court, in advising defendant of the direct consequences of his guilty plea, should have informed him of the *381 registration requirement. In view of the trial court's omission, defendant would have been entitled to relief had he interposed a timely objection to imposition of the registration requirement, and had he demonstrated he would not have pleaded guilty in the event he had been advised properly with regard to this consequence. As is made clear by the United States Supreme Court's decision in United States v. Timmreck (1979) 441 U.S. 780, 784 [60 L.Ed.2d 634, 638-639, 99 S.Ct. 2085] (discussed in our companion decision in Moser, supra, ante, pp. 354-355), however, the circumstance that a statutorily mandated consequence of a guilty plea is not embodied specifically within the terms of a plea agreement does not signify that imposition of such a consequence constitutes a violation of the agreement. Accordingly, we disagree with Justice Mosk's assertion that defendant's right to due process of law has been abridged.

III. CONCLUSION
We conclude that, although the trial court erred in failing to advise defendant that his plea of guilty to the charge of assault with intent to commit rape would result in his having to register as a sex offender, defendant is not entitled to relief, because he failed at the sentencing hearing to object to imposition of the registration requirement, the record on appeal does not establish prejudice to defendant resulting from the misadvisement, and imposition of the registration requirement does not constitute a violation of the terms of the plea agreement. Accordingly, we reverse the judgment of the Court of Appeal and direct that court to affirm the judgment of the superior court.
Lucas, C.J., Panelli, J., Arabian, J., and Baxter, J., concurred.
MOSK, J., Dissenting.
It is a violation of due process for the state to impose punishment on a defendant beyond that specified in a negotiated disposition. (Santobello v. New York (1972) 404 U.S. 257, 262 [30 L.Ed.2d 427, 433, 92 S.Ct. 495] (hereafter Santobello); People v. Walker (1991) 54 Cal.3d 1013, 1024 [1 Cal. Rptr.2d 902, 819 P.2d 861] (hereafter Walker); People v. Mancheno (1982) 32 Cal.3d 855, 860 [187 Cal. Rptr. 441, 654 P.2d 211].)
While not any deviation from the terms of the agreement is a violation of due process (Walker, supra, 54 Cal.3d at p. 1024), a variance that is significant "in the context of the plea bargain as a whole" may not be added without violating the defendant's rights. (Ibid.) Thus, for example, a punishment that is insignificant in the context of the whole agreement, such as a standard condition of probation, may be imposed "whether or not it was part *382 of the express negotiations." (Ibid.) But the imposition of a $5,000 restitution fine, a term never mentioned in the negotiations, entitles defendant to relief because it is a significant variation from the negotiated disposition. (Id., at p. 1026.)
Any doubt that defendant was entitled to appellate relief apparently never occurred to anyone other than the majority of this court. Even the Attorney General has taken the position that defendant is entitled to relief, declaring: "Petitioner agrees that appellant is constitutionally entitled to a remedy...."
I agree with the unanimous view of the Court of Appeal, the Attorney General, and the defendant in this case that the addition of a term not mentioned in the plea agreement, that is, the requirement that defendant register as a sex offender for the rest of his life, is a significant variation from the plea bargain as a whole in this case, and that defendant is entitled to some relief from the addition of this significant term to the negotiated disposition.
Only the majority of this court find that defendant is entitled to no relief. They do not dispute that a sex offender registration requirement is a significant term of punishment not contained in the negotiated disposition. Rather, they maintain that because the registration requirement was not a subject of bargaining and does not appear on the face of the plea bargain, it is not a violation of due process to impose it after the bargain was struck. (Maj. opn., ante, at pp. 379-380.) Thus, they appear to conclude that unless the plea expressly excludes a term of punishment, that term may be added ex post facto.
Such a rule is inconsistent with Walker, supra, 54 Cal.3d 1013, in which we found defendant entitled to relief from the imposition of a statutorily mandated restitution fine that was not mentioned in the plea agreement or, apparently, during negotiations. It is also inconsistent with the basic rule of Santobello, supra, 404 U.S. 257, and Walker, supra, 54 Cal.3d 1013, that due process requires sentence bargains be honored.
A sentence bargain is essentially a contract. The defendant gives up the right to trial and a potential acquittal in return for a reduction in exposure to punishment, while the prosecution gives up maximum punishment of defendant in return for a quicker, cheaper, more certain disposition. Most courts interpret the terms of a plea agreement under fundamental contract principles. (People v. Armendariz (1993) 16 Cal. App.4th 906, 911 [20 Cal. Rptr.2d 311]; People v. Ames (1989) 213 Cal. App.3d 1214, 1217 [261 Cal. Rptr. *383 911]; People v. Haney (1989) 207 Cal. App.3d 1034, 1037 [255 Cal. Rptr. 276]; Leo v. Superior Court (1986) 179 Cal. App.3d 274, 283 [225 Cal. Rptr. 15]; People v. Alvarez (1982) 127 Cal. App.3d 629, 633 [198 Cal. Rptr. 167]; see also U.S. v. Anderson (9th Cir.1992) 970 F.2d 602, 606; U.S. v. Hayes (3d Cir.1991) 946 F.2d 230, 233; U.S. v. Herrera (6th Cir.1991) 928 F.2d 769, 771; U.S. v. Keller (9th Cir.1990) 902 F.2d 1391, 1393; Plaster v. United States (4th Cir.1983) 720 F.2d 340, 352; In re Geisser (5th Cir.1980) 627 F.2d 745, 749; United States v. Bridgeman (D.C. Cir.1975) 523 F.2d 1099, 1109-1110 [173 App.D.C. 150]; Scott & Stuntz, Plea Bargaining as Contract (1992) 101 Yale L.J. 1909; Westen & Westin, A Constitutional Law of Remedies for Broken Plea Bargains (1978) 66 Cal.L.Rev. 471, 528 et seq.; cf. People v. Mortera (1993) 14 Cal. App.4th 861, 864 [17 Cal. Rptr.2d 782]; United States v. Calabrese (10th Cir.1981) 645 F.2d 1379, 1390.)
The rule espoused by the majority is inconsistent with basic contract principles. It is elementary that a mutual contract cannot be modified unilaterally. (1 Witkin, Summary of Cal. Law (9th ed. 1987) Contracts, § 909, p. 814.) To impose additional punishment on defendant that was not provided for in the plea agreement runs afoul of this fundamental rule.
The majority suggest that because the registration requirement was statutorily mandated, and thus not a proper subject for bargaining, it can be added to defendant's punishment after a negotiated disposition. (Maj. opn., ante, at p. 380.) They distinguish Walker, supra, 54 Cal.3d 1013, on the ground that there, the amount of the restitution fine was a proper subject of bargaining. Contrary to the suggestion of the majority, however, we did not grant relief in Walker, supra, 54 Cal.3d 1013, because the restitution fine was a proper subject of negotiation  as far as appeared from the record, there was no negotiation on that point in Walker, supra, 54 Cal.3d 1013. Rather, we granted relief because the negotiated plea omitted all reference to the restitution fine.
The state may not impose a significant new term of punishment that was not part of the negotiated disposition simply because the omission of that term might be inconsistent with statutory requirements. The prosecution, representing the state, may not escape its voluntary promise and still get the benefit of the guilty plea simply because its promise may have been ultra vires. (U.S. v. Anderson, supra, 970 F.2d at p. 607; Palermo v. Warden (2d Cir.1976) 545 F.2d 286, 296; see also Westen & Westin, A Constitutional Law of Remedies for Broken Plea Bargains, supra, 66 Cal.L.Rev. at pp. 531-524, and fns. 218, 219.) Although a statute may require that a certain punishment be imposed, a defendant who has pleaded guilty on other terms that do not include the required punishment is entitled to some relief: "A *384 plea induced by an unfulfillable promise is no less subject to challenge than one induced by a valid promise which the Government simply fails to fulfill." (United States v. Cook (7th Cir.1982) 668 F.2d 317, 320; see also U.S. v. Anderson, supra, 970 F.2d at p. 607, accord.)
Even if the plea agreement in the present case could somehow be viewed as ambiguous on the question whether the sex registration requirement would be imposed, courts normally interpret any ambiguity in this context against the government. "Both constitutional and supervisory concerns require holding the Government to a greater degree of responsibility than the defendant (or possibly than would be either of the parties to commercial contracts) for imprecisions or ambiguities in plea agreements." (United States v. Harvey (4th Cir.1986) 791 F.2d 294, 300; see also U.S. v. Herrera, supra, 928 F.2d at p. 772; United States v. Bowler (7th Cir.1978) 585 F.2d 851, 854; Palermo v. Warden, supra, 545 F.2d at p. 295; United States v. Crucsco (3d Cir.1976) 536 F.2d 21, 26; Correale v. United States (1st Cir.1973) 479 F.2d 944, 947.) The government "ordinarily must bear responsibility for any lack of clarity." (U.S. v. Anderson, supra, 970 F.2d at p. 607.)
In the case of any ambiguity in a plea agreement, the central question for the reviewing court is what the parties reasonably understood to be the terms of the agreement. (U.S. v. Anderson, supra, 970 F.2d at p. 607; U.S. v. Packwood (9th Cir.1988) 848 F.2d 1009, 1011.) This court has declared that the parties would reasonably understand that the sentence bargained for pursuant to a negotiated disposition would be the maximum punishment to which defendant would be subject. (People v. Flores (1971) 6 Cal.3d 305, 308-309 [98 Cal. Rptr. 822, 491 P.2d 406].) It is reasonable to conclude the parties in the present case understood that the maximum punishment to which defendant would be subject was 13 years in prison. The addition of the sex registration requirement is inconsistent with this understanding.
The majority concede that "defendant would have been entitled to relief had he interposed a timely objection." (Maj. opn., ante, at pp. 380-381.) In short, the majority contend that because of counsel's failure to raise the issue at sentencing, the defendant will be subject to punishment for the rest of his life. No court should callously compel that result.
When the state unilaterally imposes punishment beyond that memorialized in the plea bargain, due process requires that defendant be granted some relief, whether it be withdrawal of the plea followed by a trial or specific performance of the plea agreement. The defendant is entitled to such relief in this case. The Attorney General has so conceded. There is no rational reason why this court should obdurately refuse relief.
*385 KENNARD, J., Dissenting.
I join the dissenting opinion of Justice Mosk in all respects but one. Justice Mosk concludes that defendant is entitled to withdraw his guilty plea or to specific performance of the negotiated terms of the plea bargain. (Dis. opn. of Mosk, J., ante, at p. 384.) I cannot agree.
Specific performance of the plea bargain negotiated in this case would allow defendant after a conviction for assault with intent to commit rape to avoid registration as a sex offender under Penal Code section 290. Because section 290 makes registration as a sex offender mandatory for a person convicted of assault with intent rape, I would hold that the only remedy available for defendant is withdrawal of the guilty plea. (See In re Moser, ante, 342, at p. 366 [24 Cal. Rptr.2d 723, 862 P.2d 723] (dis. opn. of Kennard, J.).)
Appellant's petition for a rehearing was denied January 20, 1994. Mosk, J., and Kennard, J., were of the opinion that the petition should be granted.
NOTES
[1]  All further undesignated statutory references are to the Penal Code.
[2]  The reporter's transcript of the hearing reveals the following colloquy:

"THE COURT: [I]t is my understanding that Mr. McClellan will enter a plea to count one of the information, charging a violation of 220/261(2). He will admit the 12022.7, the enhancement, the 667 enhancement, the 667.5 enhancement, for a maximum exposure of thirteen years, and the other counts will be dismissed with a Harvey waiver. Is that your understanding?
"MR. HUMPHREY [representing the People]: Yes, your Honor.
"THE COURT: Ms. Candelaria-Ruiz?
"MS. CANDELARIA-RUIZ [representing defendant]: Yes.
"THE COURT: Mr. McClellan, is that your understanding?
"THE DEFENDANT: Yes."
Because defendant had served separate prison terms for two prior felonies, false imprisonment and first degree burglary, the trial court did not err in imposing an enhancement pursuant to section 667, subdivision (a), for the prior burglary conviction, as well as an enhancement pursuant to section 667.5, subdivision (b), for service of the prior prison term on the charge of false imprisonment. (Cf. People v. Jones (1993) 5 Cal.4th 1142 [22 Cal. Rptr.2d 753, 857 P.2d 1163] [barring imposition of the prior prison term enhancement where it stemmed from the same conduct giving rise to the enhancement for the prior felony conviction].)
[3]  Section 290 provides in pertinent part:

"(a) Any person who ... is ... convicted in this state of the offense of assault with intent to commit rape ... shall, within ... 14 days of coming into any county, city, or city and county in which he or she temporarily resides or is domiciled for that length of time register with the chief of police of the city in which he or she is domiciled or the sheriff of the county if he or she is domiciled in an unincorporated area....
".... .... .... .... .... .... ....
"(e) The registration shall consist of (1) a statement in writing signed by the person, [providing] information as may be required by the Department of Justice, and (2) the fingerprints and photograph of the person. Within three days thereafter, the registering law enforcement agency or agencies shall forward the statement, fingerprints, and photograph to the Department of Justice."
[4]  Section 1192.5 provides in pertinent part: "If the court approves of the plea, it shall inform the defendant prior to the making of the plea that (1) its approval is not binding, (2) it may, at the time set for the hearing on the application for probation or pronouncement of judgment, withdraw its approval in the light of further consideration of the matter, and (3) in such case, the defendant shall be permitted to withdraw his plea if he desires to do so."
[5]  At the time defendant filed his appeal, section 1237.5 permitted the filing of a notice of appeal following a plea of guilty, provided that the defendant filed as part of the notice of appeal a written statement showing "reasonable constitutional, jurisdictional, or other grounds going to the legality of the proceedings...." (Stats. 1988, ch. 851, § 1, pp. 2763-2764.) Defendant included in his initial notice of appeal a statement of the grounds upon which he then was relying. When the appellate court thereafter granted defendant permission to file an amended notice of appeal, it also granted him permission to file an amended section 1237.5 statement, which set forth the misadvisement claim.
[6]  Compare State v. Noble (1992) 171 Ariz. 1711 [829 P.2d 1217, 1224], cited with approval in People v. McVickers (1992) 4 Cal.4th 81, 87 [13 Cal. Rptr.2d 850, 840 P.2d 955] (Arizona statute requiring registration of sex offenders did not violate the ban on ex post facto legislation because its overriding purpose was "`facilitating the location of child sex offenders by law enforcement personnel,' a purpose unrelated to punishment").
[7]  The purpose of section 290 is "to assure that persons convicted of the crimes enumerated therein shall be readily available for police surveillance at all times because the Legislature deemed them likely to commit similar offenses in the future." (Barrows v. Municipal Court (1970) 1 Cal.3d 821, 825-826 [83 Cal. Rptr. 819, 464 P.2d 483]; see also In re Reed, supra, 33 Cal.3d 914, 919; In re Smith (1972) 7 Cal.3d 362, 367 [102 Cal. Rptr. 335, 497 P.2d 807]; In re DeBeque (1989) 212 Cal. App.3d 241, 248 [260 Cal. Rptr. 441]; People v. Monroe (1985) 168 Cal. App.3d 1205, 1210 [215 Cal. Rptr. 51]; 3 Witkin & Epstein, Cal. Criminal Law (2d. ed. 1989) Punishment for Crime, §§ 1416-1417, pp. 1678-1681.) The statute "imposes a lifelong requirement of registration and re-registration absent a court order releasing the registrant from the penalties and disabilities of his conviction under section 1203.4 ... or the issuance of a certificate of rehabilitation under section 4852.01 et seq." (Barrows v. Municipal Court, supra, 1 Cal.3d at p. 825, citation and fns. omitted.)
[8]  Certain other statutory provisions mandate imposition of a registration requirement upon persons convicted of specified offenses. (See, e.g., Health & Saf. Code, §§ 11590-11595 [registration of controlled-substance offenders].) Additionally, section 457.1 permits registration of persons convicted of arson or attempted arson under specified circumstances. (See generally, 3 Witkin & Epstein, Cal. Criminal Law, supra, Punishment for Crime, §§ 1416-1419, pp. 1678-1682.) A trial court's duty to advise a defendant of the direct consequences of a guilty plea applies to these other statutory registration requirements, as well as to the sex offender registration requirement at issue in the present case. (See, e.g., People v. Cotton (1991) 230 Cal. App.3d 1072, 1083-1085 [284 Cal. Rptr. 757] [trial court must advise defendant whenever controlled-substance registration requirement is applicable].)
[9]  Because the trial court failed to follow the requirements of section 1192.5 (see fn. 4, ante, and accompanying text), defendant's claim that the sex offender registration requirement violated the terms of the parties' plea agreement is not waived by his failure to interpose a timely objection. (See People v. Walker, supra, 54 Cal.3d at pp. 1024-1026.)
