
22 Cal.Rptr.3d 680 (2004)
125 Cal.App.4th 223
The PEOPLE, Plaintiff and Respondent,
v.
Donald RENFRO, Defendant and Appellant.
No. B172451.
Court of Appeal, Second District, Division Six.
December 22, 2004.
Review Denied April 13, 2005[*].
*681 Rudy Kraft, under appointment by the Court of Appeal, for Defendant and Appellant.
Bill Lockyer, Attorney General, Robert R. Anderson, Chief Assistant Attorney General, Pamela C. Hamanaka, Senior Assistant Attorney General, Robert F. Katz, Supervising Deputy Attorney General, Louis W. Karlin, Deputy Attorney General, for Plaintiff and Respondent.
PERREN, J.
While confined as a mentally disordered offender (MDO) (Pen.Code, § 2960 et seq.),[1] Donald Renfro physically attacked hospital personnel. Prosecuted for offenses arising from this incident, Renfro entered into a plea bargain that not only included a guilty plea to one offense, but also declared that the offense was not caused or aggravated by a severe mental disorder and could not be used as a qualifying offense for a subsequent MDO commitment. (§ 2962, subd. (b).)
Before his release from prison, the Board of Prison Terms determined that Renfro was an MDO and, contrary to his plea bargain, MDO proceedings were initiated. At trial, the court refused to enforce the plea agreement, and found that Renfro satisfied all criteria for commitment as an MDO. Renfro appeals from the judgment, contending that the trial court violated his constitutional right to the benefit of his plea agreement.
We hold that a plea bargain may not be conditioned on a judicial finding that the subject offense falls outside the MDO law. We conclude that the provision in Renfro's plea agreement that prevents use of his offense as the qualifying offense for commitment as an MDO is not a proper subject for a plea agreement and may not be *682 enforced by specific performance. We affirm.

FACTS AND PROCEDURAL HISTORY
While confined as an MDO at Patton State Hospital in San Bernardino County, Renfro struck and seriously injured two hospital staff members with a chair and bit, punched and scratched two other staff members. He was charged with four counts of assault with a deadly weapon or by means of force likely to produce great bodily injury (§ 245, subd. (a)(1)), and three counts of criminal threats (§ 422).
Pursuant to a plea agreement, Renfro pled guilty to the offense of resisting an executive officer by threat or violence (§ 69), and agreed to a three-year prison sentence for that offense. In return, the other charges were dismissed.
The plea agreement also provided: "This Plea Shall Not constitute basis for MDO .... As part of Plea Agreement it is hereby found that No Severe Mental disorder was the cause of or an Aggravating factor in this crime. Therefore I will not fall under the MDO Statute." Another provision of the plea agreement states that Renfro's counsel advised him that, as a consequence of the plea, he "is not eligible to be found MDO in future."
Renfro, Renfro's counsel, and the prosecutor signed the plea agreement. After finding a factual basis for the guilty plea, the San Bernardino County trial court accepted the plea agreement and sentenced Renfro to the agreed upon three years in state prison. The trial court generally advised Renfro of his constitutional rights, but did not refer to the provisions of the plea agreement concerning future exposure to an MDO commitment.
While serving his prison sentence in 2003, Renfro was examined by several doctors who concluded that he met the criteria for treatment as an MDO pursuant to section 2962 based on the underlying offense of resisting an executive officer. After Renfro was admitted to Atascadero State Hospital, the Board of Prison Terms conducted a hearing and determined that he met the criteria for MDO treatment and commitment. In September 2003, Renfro filed a petition in the San Luis Obispo County Superior Court challenging the determination by the Board of Prison Terms.
Renfro waived his right to a jury trial and was tried by the court. The court heard medical testimony that Renfro met the statutory requirements for commitment and treatment as an MDO. Of the seven examining and treating psychiatrists and psychologists who provided evidence, six concluded that Renfro was an MDO. Based on this evidence, the trial court found that Renfro qualified for commitment and treatment, and denied his petition.
Renfro's plea agreement was admitted into evidence and counsel argued whether the MDO provisions of the agreement were binding on the court. The trial court ruled that the plea agreement was not binding because, among other reasons, it was part of the criminal case and, therefore, did not prevent an MDO finding in the commitment proceeding.
Renfro appeals the denial of his MDO petition and his commitment for treatment.

DISCUSSION
Renfro contends that the trial court violated his constitutional right to due process by failing to honor his plea agreement. He does not challenge the sufficiency of the evidence that he qualified as an MDO, but argues that the plea agreement in the underlying criminal case prevented the trial court from ordering him committed as an MDO. Respondent concedes that *683 a defendant has a due process right to the benefit of a plea bargain, but contends that Renfro waived his constitutional claim by relying solely on contract and res judicata principles in the trial court.
We disagree with both positions. We reject Renfro's argument as well as respondent's concession that, apart from waiver, the MDO provision in Renfro's plea agreement could be enforced on constitutional grounds.[2]
We conclude that Renfro does not have a constitutional or contractual right to specifically enforce the MDO provision in the plea agreement. A defendant with a severe mental disorder may not plead guilty to a felony covered by the MDO law and, at the same time, preclude the possibility of future commitment as an MDO. To permit such a plea agreement would, in effect, nullify a mandatory statutory parole scheme, and would preclude a civil proceeding unrelated to punishment for the criminal offense, and largely unrelated to the commission of the underlying offense.
We recognize that plea bargaining is a widely used practice that is essential to the efficient and fair operation of the criminal justice system. (People v. West (1970) 3 Cal.3d 595, 604, 91 Cal.Rptr. 385, 477 P.2d 409.) As a general rule, a plea bargain approved by the court is enforceable under contract principles. (See Santobello v. New York (1971) 404 U.S. 257, 260-261, 92 S.Ct. 495, 30 L.Ed.2d 427; People v. Walker (1991) 54 Cal.3d 1013, 1024, 1 Cal.Rptr.2d 902, 819 P.2d 861.) "When a guilty plea is entered in exchange for specified benefits such as the dismissal of other counts or an agreed maximum punishment, both parties, including the state, must abide by the terms of the agreement." (Walker, at p. 1024, 1 Cal. Rptr.2d 902, 819 P.2d 861.) In addition, violation of a plea bargain by an officer of the state so as to significantly increase the defendant's punishment beyond that set forth in the plea agreement raises a constitutional due process right to some remedy. (Ibid.; see also People v. Mancheno (1982) 32 Cal.3d 855, 860, 187 Cal.Rptr. 441, 654 P.2d 211.)
The prosecution and criminal court, however, do not have unfettered discretion in determining the subject matter of a plea bargain. The court must exercise its sentencing authority in accordance with the Penal Code, public policy, and decisional law. (See In re Troglin (1975) 51 Cal.App.3d 434, 438, 124 Cal. Rptr. 234.) Plea bargaining is a method of disposing of criminal prosecutions through a guilty plea by the defendant in return for "a reciprocal benefit, generally consisting of a less severe punishment than that which could result if he were convicted of all offenses charged." (People v. Orin (1975) 13 Cal.3d 937, 942, 120 Cal.Rptr. 65, 533 P.2d 193.) A plea bargain is limited to "powers legally available to" the court (§ 1192.5),[3] and the reciprocal benefit to a defendant must relate to the sentence for the criminal charges against the defendant. (§ 1192.7, subd. (b).)[4]
*684 Precluding a defendant's exposure to an MDO commitment as a condition of a guilty plea to a criminal offense is a power not legally available to the prosecution or trial court for inclusion in a negotiated plea to criminal charges. Application of the MDO law is not a discretionary element of sentencing. The MDO law establishes a statutory scheme for the medical evaluation of prisoners, and the commitment of prisoners with severe and dangerous mental disorders. A commitment for MDO treatment is a condition of parole initially determined by the Department of Corrections and Board of Prison Terms and imposed by the court in a proceeding entirely separate from the criminal proceeding.
Specifically, the MDO law directs the Department of Corrections to "evaluate each prisoner for severe mental disorders during the first year of the prisoner's sentence," provide mental health treatment during incarceration, and determine whether a prisoner's mental condition requires a commitment for further treatment as a condition of the prisoner's parole. (§§ 2960, 2962.) If the department determines that a commitment is necessary, the prisoner may request a hearing before the Board of Prison Terms. (§ 2966, subd. (a).) If the Board of Prison Terms finds that the MDO criteria are met, the prisoner may file a petition "in the superior court of the county in which he or she is incarcerated or is being treated" for an evidentiary hearing to determine whether he or she meets the criteria. (§ 2966, subd. (b).)
To order a commitment, the court must find that the mental disorder was a cause of or an aggravating factor in the commission of a criminal offense, and must also make three other factual findings concerning the prisoner's mental condition at the time his or her prison sentence is being completed. (§ 2962.) There must be findings that the prisoner has a severe mental disorder that is not in remission or cannot be kept in remission without treatment, the prisoner has been in treatment for at least 90 days during the year before parole, and the prisoner has been certified by a mental health professional to represent a substantial danger of physical harm to others by reason of his or her disorder. (§ 2962, subds.(a), (c), (d).)
Although related to the crime for which a person was imprisoned, an MDO proceeding focuses on criteria determined by mental health professionals. Accordingly, it is established that an MDO proceeding is civil in nature, not criminal. (People v. Cosgrove (2002) 100 Cal.App.4th 1266, 1273, 123 Cal.Rptr.2d 535; People v. Superior Court (Myers) (1996) 50 Cal. App.4th 826, 837-841, 58 Cal.Rptr.2d 32.)
An MDO proceeding is commenced at the time of a prisoner's parole, and the proceeding is governed by criteria and conduct that assess the prisoner's mental condition at the time of parole, not just at the time of the crime. An MDO proceeding is intended to determine whether prisoners with severe mental disorders can be safely released into society at the time of the completion of their prison sentences. (§§ 2960, 2962; see also People v. Fernandez (1999) 70 Cal.App.4th 117, 129, 82 Cal. Rptr.2d 469.) An MDO commitment does not alter or extend, directly or indirectly, *685 the prison sentence imposed for the defendant's criminal conduct. "The purpose of the MDO statutory scheme is to provide mental health treatment for those offenders who are suffering from presently severe mental illness, not to punish them for their past offenses." (People v. Superior Court (Myers), supra, 50 Cal.App.4th at p. 837, 58 Cal.Rptr.2d 32.)
Unquestionably, the trial court in Renfro's criminal case did not purport to conduct, and did not have jurisdiction to conduct, an MDO hearing or to make factual determinations concerning MDO criteria. The court made a finding that there was a factual basis for Renfro's guilty plea, but engaged in no other fact-finding process. Specific performance of the MDO provision of Renfro's plea agreement would permit the sentencing court to determine prospectively that, at the time of his parole, Renfro would not pose a significant danger to society as the result of a severe mental disorder. In so doing, the sentencing court would eliminate the mandated role of the Board of Prison Terms and mental health professionals in an MDO proceeding, and would bargain away the independent judicial power of a court in another proceeding. (Cf. People v. Allen (1975) 46 Cal.App.3d 583, 591, 120 Cal.Rptr. 127; People v. Scott (1984) 150 Cal.App.3d 910, 920, 198 Cal.Rptr. 124.)
Furthermore, an MDO commitment is a condition of parole, and it is established that imposition and duration of a parole term is not a permissible subject of plea negotiations. (See People v. McMillion (1992) 2 Cal.App.4th 1363, 1368-1369, 3 Cal.Rptr.2d 821; In re Moser (1993) 6 Cal.4th 342, 357, 24 Cal.Rptr.2d 723, 862 P.2d 723.) Parole is a statutorily mandated element of punishment, and neither the prosecution nor the sentencing court has authority to impose a prison sentence without parole or to alter the applicable period of parole established by the Legislature and imposed by the Board of Prison Terms. (McMillion, at p. 1369, 3 Cal.Rptr.2d 821; Moser, at p. 357, 24 Cal.Rptr.2d 723, 862 P.2d 723; see also People v. Victorian (1992) 2 Cal.App.4th 954, 959, 4 Cal.Rptr.2d 460.)
Renfro contends, however, that even if the plea agreement is invalid, it should be enforced under principles of estoppel. Renfro asserts that he "made a deal" with the State of California and performed his obligation under the deal by serving his three-year prison sentence and, therefore, that he is entitled to reversal of the judgment of commitment and immediate release from confinement.
There is some merit in Renfro's claim that the prosecution broke its promise. "As the moving party in a criminal action, it is the prosecutor's responsibility to correctly advise, or make sure that the trial court correctly advises, the defendant of the permissible penalty scheme." (People v. Velasquez (1999) 69 Cal.App.4th 503, 505-507, 81 Cal.Rptr.2d 647.) The error in the criminal case can be characterized as a broken promise entitling Renfro to some remedy, but we conclude that specific performance is not an appropriate remedy in this case.
The remedy for violation of a plea agreement depends on the circumstances of each case. (People v. Mancheno, supra, 32 Cal.3d at p. 860, 187 Cal. Rptr. 441, 654 P.2d 211.) The typical remedy is to allow the defendant to withdraw his or her guilty plea and go to trial on the original charges. (Id., at pp. 860-861, 187 Cal.Rptr. 441, 654 P.2d 211.) Under certain circumstances, specific performance of the agreement is warranted, but it is not a favored remedy for violation of a plea bargain. (Ibid.) And, specific enforcement of a plea bargain is not a remedy required by the federal Constitution. (In re Alvernaz (1992) 2 Cal.4th 924, 942, 8 Cal.Rptr.2d 713, 830 P.2d 747.)
*686 As we have concluded, the MDO provision of Renfro's plea agreement went beyond the sentencing court's authority. Specific performance of the plea agreement would undermine the MDO law and, in so doing, undermine public policy, public safety and the administration of justice by our courts. (See In re Alvernaz, supra, 2 Cal.4th at p. 942, 8 Cal.Rptr.2d 713, 830 P.2d 747; People v. Calloway (1981) 29 Cal.3d 666, 672, 175 Cal.Rptr. 596, 631 P.2d 30 [defendant sentenced in violation of plea bargain was not entitled to specific performance; fairness demanded only that he be given opportunity to withdraw his plea].) In addition, specific enforcement of the plea agreement would compel the reversal of a ruling in the MDO case that is supported by the evidence and would release Renfro from confinement, despite the danger he presents to society as an MDO.
We do not foreclose, however, the possibility that Renfro could file a petition for writ of habeas corpus in the criminal case, seeking to withdraw his guilty plea. We recognize that Renfro has served his prison sentence in apparent reliance on the provisions barring MDO proceedings as set forth in his plea agreement, and that withdrawal of his guilty plea would not return him or the prosecution to the same status as existed before the plea. Nevertheless, such an action, if successful, would give Renfro an opportunity to prevent further commitment as an MDO, and his prison sentence would constitute time served in any other disposition of the underlying criminal charges.
The judgment (order of commitment) is affirmed.
We concur: GILBERT, P.J., and COFFEE, J.
NOTES
[*]   Werdegar, J., and Brown, J., dissented.
[1]  All statutory references are to the Penal Code unless otherwise stated.
[2]  We also reject respondent's waiver argument. There was no waiver because Renfro effectively raised the due process question in the trial court by arguing the enforceability of the plea agreement, and because his claim involves a pure question of law. (See People v. Smith (2001) 24 Cal.4th 849, 852-853, 102 Cal.Rptr.2d 731, 14 P.3d 942; People v. Scott (1994) 9 Cal.4th 331, 353, 36 Cal.Rptr.2d 627, 885 P.2d 1040.)
[3]  Section 1192.5 provides, in relevant part, that a plea "may specify the punishment to the same extent as it may be specified by the jury on a plea of not guilty or fixed by the court on a plea of guilty, nolo contendere, or not guilty, and may specify the exercise by the court thereafter of other powers legally available to it."
[4]  Section 1192.7, subdivision (b) defines plea bargaining as "any bargaining, negotiation, or discussion between a criminal defendant, or his or her counsel, and a prosecuting attorney or judge, whereby the defendant agrees to plead guilty or nolo contendere, in exchange for any promises, commitments, concessions, assurances, or consideration by the prosecuting attorney or judge relating to any charge against the defendant or to the sentencing of the defendant."
