
110 Wn.2d 528 (1988)
756 P.2d 122
THE STATE OF WASHINGTON, Petitioner,
v.
RONALD SHELLIE MILLER, Respondent.
No. 54289-9.
The Supreme Court of Washington, En Banc.
May 26, 1988.
David F. Thiele, Prosecuting Attorney, and William H. Hawkins, Deputy, for petitioner.
Anthony Savage, for respondent.
UTTER, J.
We hold Ronald S. Miller is entitled to withdraw his guilty plea made pursuant to a plea agreement, where the parties to the agreement were mistaken as to the relevant mandatory sentence.


*529 I
On June 2, 1985, Thomas Bruce died of multiple gunshot wounds. Ronald Miller admitted to his estranged wife and three friends he had shot Bruce. After being informed of and waiving his constitutional rights to remain silent, and to a lawyer, Miller stated to the police officers who arrested him, "I shot Thomas with a .22 caliber rifle." He further confessed he had decided to shoot Thomas that morning, and had waited so that his wife and children would not see the shooting. Miller was charged with first degree murder.
On November 6, 1985, Miller entered a plea of guilty to first degree murder pursuant to a plea agreement between Miller and the prosecuting attorney. The terms of the plea agreement specified that Miller would be free to argue his sentencing, including recommending an exceptional sentence of less than 20 years. Under the agreement, the State would not agree to an exceptional sentence but would recommend a term of 20 years. The standard range for first degree murder with no prior offenses is 240 to 320 months. RCW 9.94A.310.
Before entering the guilty plea, Miller had been misinformed by his attorney, who in turn had been misinformed by the prosecutor, that the possibility of a sentence less than 20 years existed. Under RCW 9.94A.120(4) the mandatory minimum term for first degree murder is 20 years. The incorrect legal advice Miller received regarding the possibility of an exceptional sentence of less than 20 years was the result of inadvertence, and not bad faith by his attorney or the prosecutor, who had both overlooked the provisions of RCW 9.94A.120(4).
Three months after entering the plea, and before a sentence was pronounced, Miller was correctly informed about the 20-year mandatory sentence for first degree murder. He then moved to withdraw his guilty plea. The court denied that motion, and ruled that the plea agreement between the parties could be specifically enforced, notwithstanding the statutory mandatory minimum sentence. In denying the *530 motion to withdraw the guilty plea, the trial court entered findings that the discrepancy between the possible exceptional sentence of approximately 15 years anticipated by Miller and the mandatory minimum provided by statute was not alarmingly disproportionate when gauged by the maximum term, the seriousness of the offense and the potentially more aggravated sentence Miller avoided by his plea. The court further found that overwhelming evidence would be admissible against Miller; Miller had readily admitted his guilt to friends, family members, the police and in open court, and thus a trial would be unnecessary and useless.
The trial court held that, notwithstanding the proscription of RCW 9.94A.120(4) against an exceptional sentence of less than 20 years for first degree murder, Miller was entitled to be sentenced within the range established at the plea hearing, or outside that range if the court were to find substantial and compelling reasons justifying an exceptional sentence. The court found, under all the facts and circumstances of the case, the interests of justice would be better served by a grant of specific performance and by giving Miller the benefit of his bargain, rather than by allowing Miller to withdraw his plea of guilty.
Despite the court's ruling allowing consideration of a term less than the mandatory minimum, Miller's counsel argued for a 20-year sentence, based on his analysis that 20 years was the mandatory minimum. The State also recommended a 20-year sentence. At the time of sentencing, the attorneys did not present the court with any aggravating or mitigating circumstances, and the court sentenced Miller to a 20-year term.
Miller appealed the denial of his motion to withdraw his guilty plea, and the Court of Appeals reversed the trial court, holding Miller was entitled to withdraw his plea. State v. Miller, 48 Wn. App. 625, 742 P.2d 723 (1987). This court granted the State's petition for review.


*531 II
A defendant must understand the sentencing consequences for a guilty plea to be valid. Wood v. Morris, 87 Wn.2d 501, 503, 513, 554 P.2d 1032 (1976). Here, all parties agree that Miller did not understand the sentencing consequences of pleading guilty to first degree murder, and was thus entitled to some remedy.
This court has recognized two possible remedies where a defendant has entered a guilty plea pursuant to a plea agreement based on misinformation or where the prosecutor refuses to abide by the terms of the agreement. "The court can permit the accused to withdraw his plea and be tried anew on the original charges, or grant specific performance of the agreement." State v. Tourtellotte, 88 Wn.2d 579, 585, 564 P.2d 799 (1977); see also State v. Harris, 41 Wn. App. 561, 705 P.2d 280 (1985). In this case the trial court ordered specific performance of the agreement, despite Miller's request for the remedy of allowing withdrawal of his plea.
CrR 4.2(f) states:
The court shall allow a defendant to withdraw the defendant's plea of guilty whenever it appears that the withdrawal is necessary to correct a manifest injustice. If the defendant pleads guilty pursuant to a plea agreement and the court later determines under RCW 9.94A.090 that the agreement is not binding, the court shall inform the defendant that the guilty plea may be withdrawn and a plea of not guilty entered.
RCW 9.94A.090 states, in relevant part, "[t]he court, at the time of the plea, shall determine if the agreement is consistent with the interests of justice and with the prosecuting standards." These provisions shed little light on whether a defendant is entitled to withdraw a plea where the prosecutor offers to enforce the specific terms of the plea bargain for the defendant's benefit. Here, the trial court determined that the interests of justice made the plea bargain "binding"; at issue is the correctness of this determination.
*532 Miller argues that the court was statutorily constrained from enforcing the terms of the plea agreement which allowed Miller to argue for a sentence less than the 20-year mandatory minimum of RCW 9.94A.120(4), a statute within the Sentencing Reform Act of 1981.[1] Miller argues the plea agreement was not legal and therefore unenforceable; the only appropriate remedy for the mutual mistake underlying the agreement is to allow him to withdraw his guilty plea. We do not accept this analysis. We have held that where fundamental principles of due process so dictate, the specific terms of a plea agreement based on a mistake as to sentencing consequences may be enforced despite the explicit terms of a statute. State v. Cosner, 85 Wn.2d 45, 530 P.2d 317 (1975).
In Cosner, petitioners Cramer and Christian pleaded guilty after being informed that the mandatory minimum would be 5 years. The petitioners were not advised that, because of a prior felony conviction, the special finding they were armed with deadly weapons would result in 7 1/2-year and 8 1/2-year mandatory minimum terms, respectively. Cosner, at 49-50. This court stated:
Petitioners Cramer and Christian, while advised of the involvement of a mandatory minimum were, nevertheless, misinformed as to the length thereof. Their petitions are accordingly granted to the extent that the Board of Prison Terms and Paroles is directed to reduce their mandatory minimum terms in accordance with their understanding of the length thereof at the time of their pleas.
Cosner, at 51-52.
Cosner demonstrates that the court is not absolutely bound by the statutory mandatory minimum where it conflicts with the terms of a plea agreement. Accord, In re *533 Williams, 21 Wn. App. 238, 583 P.2d 1262 (1978). Defendants' constitutional rights under plea agreements take priority over statutory provisions. See In re James, 96 Wn.2d 847, 849, 640 P.2d 18 (1982). We decline to hold here that withdrawal of a plea is the only legal remedy where the plea agreement clashes with the Sentencing Reform Act of 1981.
Moreover, unlike the instant case, if the defendant does not wish withdrawal of the plea, that "remedy" may be unjust, especially where the defendant has relied to his or her detriment on the plea bargaining process by giving evidence to the State. See Note, The Legitimation of Plea Bargaining: Remedies for Broken Promises, 11 Am. Crim. L. Rev. 771, 792-93 (1973). As this court stated in State v. Tourtellotte, 88 Wn.2d 579, 585, 564 P.2d 799 (1977): "To place the defendant in a position in which he must again bargain with the state is unquestionably to his disadvantage. The security he had gained as a result of the plea negotiation from being charged with the more grievous offense would be lost. The defendant is entitled to the benefit of his original bargain." (Citations omitted.) To the extent that the opinion of the Court of Appeals below and in State v. Perkins, 46 Wn. App. 333, 730 P.2d 712 (1986) hold that withdrawal of the plea is the only remedy for errors in a plea agreement discovered before sentencing, we disapprove those holdings.
The State argues that the trial court should have the discretion to determine the appropriate remedy. The State bases this argument in large part on the decision of the Court of Appeals in State v. Pope, 17 Wn. App. 609, 564 P.2d 1179, review denied, 89 Wn.2d 1009 (1977). In Pope, the defendant was misinformed the mandatory minimum sentence for his crime was 5 years, where it was in fact 20 years. The defendant sought collateral relief after the Board of Prison Terms and Paroles set his mandatory minimum term at 20 years. Instead of granting the requested relief of specific performance, the trial court allowed the defendant to withdraw his guilty plea. The Court of *534 Appeals affirmed the trial court's denial of specific performance and stated that the trial court should have "full discretion" to select the type of relief justified by the circumstances of the particular case. Pope, at 614-15.
[1] Our opinion in Tourtellotte was filed a few days after the decision in Pope. In Tourtellotte we held: "`a court ought to accord a defendant's preference considerable, if not controlling, weight inasmuch as the fundamental rights flouted by a prosecutor's breach of a plea bargain are those of the defendant, not of the State.'" 88 Wn.2d at 585, quoting Santobello v. New York, 404 U.S. 257, 267, 30 L.Ed.2d 427, 92 S.Ct. 495 (1971) (Douglas, J., concurring).[2] Although this case does not involve a prosecutor's deliberate breach of a plea agreement, the defendant's preference as to remedy should be the primary focus of the court. To the extent that Pope holds the court, rather than the defendant, is entitled to the choice of remedy, it is incorrect.
In In re James, supra, a per curiam decision granting a personal restraint petition, this court addressed, but did not ultimately clarify, the issue of the weight to be given the defendant's choice of remedy. In James, the defendant, who was mentally handicapped, negotiated a plea agreement under which the prosecutor was to recommend probation. The prosecutor then refused to recommend probation because the defendant had been charged with two additional misdemeanors after the entry of the plea. This court held that the defendant was entitled to the terms of the plea agreement, and as the defendant had not specified a choice of remedy, remanded to the trial court to determine the remedy. We stated, "[t]he appropriate *535 remedy is for the trial court to decide, with the defendant's preference to be accorded considerable weight." James, at 852. We then cited Tourtellotte, which grants the defendant's preference "considerable, if not controlling, weight", Tourtellotte, at 585; Pope, which grants "full discretion in the trial court", Pope, at 614; and In re Palodichuk, 22 Wn. App. 107, 589 P.2d 269 (1978), in which the defendant was given the choice of remedy, Palodichuk, at 113. Our decision in James thus fails to resolve the apparent conflict in those authorities.
We hold now that the defendant's choice of remedy controls, unless there are compelling reasons not to allow that remedy. There may be circumstances under which the defendant's choice of remedy would be unfair to other parties. For example, a defendant's choice of specific performance as a remedy for a plea agreement in violation of the Sentencing Reform Act of 1981 may be unfair if the violation was caused by misinformation provided by the defendant. See In re Baca, 34 Wn. App. 468, 662 P.2d 64 (1983). Similarly, the choice of plea withdrawal may be unfair if the prosecutor has detrimentally relied on the bargain and has lost essential witnesses or evidence. See United States v. Jerry, 487 F.2d 600 (3d Cir.1973) (loss of physical evidence and difficulty in relocating key witnesses); Farnsworth v. Sanford, 115 F.2d 375 (5th Cir.1940) (52 witnesses dismissed after plea).
Here, the State has not shown how it would be prejudiced by allowing Miller to withdraw his plea. To the contrary, the State asserts that the evidence against Miller is so overwhelming that going through with a trial would be a useless act. "If the prosecution's only showing is that of `disappointed expectations,' the defendant's motion [to withdraw plea] should be granted." 3 American Bar Ass'n, Standards for Criminal Justice, Std. 14-2.1(a), at 14.54 (2d ed. 1982). Miller should therefore be granted his chosen remedy of withdrawal of his plea.


*536 III
Although we affirm the Court of Appeals, we cannot completely agree with the reasons used by it. It held the fact that Miller had not yet been sentenced controlling, stating that the trial court should not allow specific performance and knowingly impose a sentence that violates the sentencing reform act. Miller, at 630. However, the integrity of the plea bargain process requires that defendants be entitled to rely on plea bargains as soon as the court has accepted the plea. State v. Tourtellotte, supra at 585. The trial court is required to determine the validity of the plea agreement before accepting the plea. RCW 9.94A.090. It is at this point that the defendant is entitled to rely on the benefit of the bargain, not the time of sentencing.
In Tourtellotte, the defendant entered into a plea bargain, the terms of which were that in exchange for a guilty plea on the arson charge the prosecuting attorney would not pursue larceny charges and would make no sentencing recommendation. 88 Wn.2d at 581. After the victims learned of and objected strongly to the plea bargain, and before sentencing, the court granted the State's motion to have the guilty plea of the defendant withdrawn. This court reversed and stated, "A plea bargain is a binding agreement between the defendant and the State which is subject to the approval of the court." Tourtellotte, at 584. We here reaffirm Tourtellotte, and hold that the integrity of the plea bargaining process requires that once the court has accepted the plea, it cannot ignore the terms of the bargain, unless the defendant, as is the case here, chooses to withdraw the plea.
In summary, we hold that where the terms of a plea agreement conflict with the law or the defendant was not informed of the sentencing consequences of the plea, the defendant must be given the initial choice of a remedy to specifically enforce the agreement or withdraw the plea. The prosecutor bears the burden of demonstrating that the defendant's choice of remedy is unjust.
*537 Miller requested withdrawal of his guilty plea made on the basis of a misunderstanding of the mandatory minimum sentence. The prosecutor has not demonstrated any prejudicial reliance on the plea. The trial court therefore erred in denying Miller's motion to withdraw his guilty plea. We affirm the Court of Appeals.
PEARSON, C.J., and DOLLIVER, DORE, and CALLOW, JJ., concur. DURHAM, J. (concurring in the result)
Because he was misinformed about the punitive consequences of his plea of guilty to first degree murder, Ronald Miller seeks to withdraw the plea. No one denies that the erroneous legal advice Miller received vitiates his plea and entitles him to relief. See Correale v. United States, 479 F.2d 944 (1st Cir.1973) (discussing similar situation). The question presented here is what form that relief should take.
The law of remedies for invalid pleas is not well settled. With respect to pleas such as Miller's which are determined to be invalid because entered in reliance on an "unfulfillable promise", several questions arise:
Should the defendant simply be permitted to plead anew to the original charges? Should the bargain be enforced? Should the defendant have his druthers? Should the trial judge determine which remedy better satisfies due process in each case?
J. Bond, Plea Bargaining and Guilty Pleas § 7.19, at 7-54 (1983).
The majority suggests some answers. "We hold now that the defendant's choice of remedy controls, unless there are compelling reasons not to allow that remedy." Majority opinion, at 535. "We decline to hold here that withdrawal of a plea is the only legal remedy where the plea agreement clashes with the Sentencing Reform Act of 1981." Majority opinion, at 533. Because I disagree completely with the latter statement, and question the wisdom of the former, I cannot join in the opinion of the majority.


*538 I
In support of its assertion that "the specific terms of a plea agreement based on a mistake as to sentencing consequences may be enforced despite the explicit terms of a statute", majority opinion, at 532, the court relies on State v. Cosner, 85 Wn.2d 45, 530 P.2d 317 (1975). In Cosner, this court ordered the Board of Prison Terms and Paroles to reduce the sentences of two defendants who, when pleading guilty, had been misinformed as to the length of the mandatory minimum terms for their crimes. The upshot of this ruling was that the defendants could receive minimum terms which were lower than those mandated by law.
To my mind, this is an impossible result. There simply is no credible legal argument that can be made for the proposition that a court  or, as in Cosner, another sentencing agency  may exceed its statutory sentencing authority in order to enforce the terms of a plea agreement. See In re Gardner, 94 Wn.2d 504, 507, 617 P.2d 1001 (1980). It is not surprising, therefore, that the Cosner opinion cites no authority and offers no explanation for its holding. See Cosner, at 51-52. Nor is it astounding that, other than those cases which rely on Cosner, none can be found proclaiming the radical principle the majority today asserts.[3]
The majority offers that "[d]efendants' constitutional rights under plea agreements take priority over statutory provisions". Majority opinion, at 533. I fail to see any constitutional reason why a plea agreement that conflicts with *539 a valid statute should be enforced, however. The fact that entering a plea "involves the waiver of several constitutional rights", In re James, 96 Wn.2d 847, 849, 640 P.2d 18 (1982), is no reason. Those rights are restored when the plea is permitted to be withdrawn.[4] Nor may the sentencing laws be overlooked in favor of a putative constitutional right "to protection of the reasonable expectations created in [defendants] by plea agreements with the state." Westen & Westin, A Constitutional Law of Remedies for Broken Plea Bargains, 66 Calif. L. Rev. 471, 528 (1978). Recent cases refute the existence of any such right. See Mabry v. Johnson, 467 U.S. 504, 510 n. 11, 81 L.Ed.2d 437, 104 S.Ct. 2543 (1984); Johnson v. Lumpkin, 769 F.2d 630, 633-34 (9th Cir.1985).
There being no constitutional right or rule that would supersede RCW 9.94A.120(4), the trial court has no authority to ignore that statute. That is why the only remedy for Miller's invalid plea is rescission.

II
Because rescission is the only permissible remedy in this case, it is unnecessary for this court to discuss what factors might influence the choice of remedies in other cases where a plea agreement is breached or the validity of the defendant's plea is otherwise impaired. Insofar as the majority's opinion does issue dicta on this question, however, I feel it appropriate to offer some observations of my own.
The majority holds that "the defendant's choice of remedy controls, unless there are compelling reasons not to allow that remedy." Majority opinion, at 535. I find this rule at once too rigid and too vague. As the majority itself acknowledges by its "compelling reasons" limitation, a strict rule of "defendant's choice" is impracticable. There is a wide variety of reasons why improvident guilty pleas *540 might need remedying. Thus, most courts leave to trial court discretion the task of fashioning relief tailored to the circumstances of each case.[5] J. Bond § 7.19(d); see also Santobello v. New York, 404 U.S. 257, 263, 30 L.Ed.2d 427, 92 S.Ct. 495 (1971); Correale v. United States, supra at 949-50.
The rigidity of the "defendant's choice" rule is not usefully mollified by the "compelling reasons" exception the majority posits. What constitutes a "compelling reason" will vary greatly according to the circumstances of each plea bargain. Thus, the majority's new rule will not effectively limit trial courts' discretion to fashion appropriate remedies, except to the extent it affords appellate courts a catch-phrase mechanism for undoing remedies of which they disapprove.
I agree with the majority that the law of remedies for broken plea bargains needs development and clarification. See generally J. Bond § 7.9(e); Specific Performance of "Unfulfillable" Plea Bargains, 14 U. Mich. J.L. Ref. 105 (1980). However, I believe it is unnecessary and unwise in this case to declare a rule of "defendant's choice".

III
Miller's plea is not valid because he "was not fairly apprised of its consequences". Mabry v. Johnson, supra at 509. Thus, he is entitled to some form of relief. Specific performance of the plea agreement is impossible, in that the court has no authority to impose the sentence Miller was led to believe he might receive. Therefore, rescission is the only remedy available. For these reasons, I believe the *541 Court of Appeals decision ordering rescission should be affirmed.
BRACHTENBACH, ANDERSEN, and GOODLOE, JJ., concur with DURHAM, J.
NOTES
[1]  RCW 9.94A.120(4) states, in relevant part:

"An offender convicted of the crime of murder in the first degree shall be sentenced to a term of total confinement not less than twenty years.... The foregoing minimum terms of total confinement are mandatory and shall not be varied or modified as provided in subsection (2) [exceptional sentence provision] of this section."
[2]  The majority of the Court in Santobello gave the state court the discretion as to which remedy it would grant. Santobello, at 263. However, the dissenters agreed with Justice Douglas' concurrence that, where the defendant seeks the remedy of withdrawing a guilty plea, this should be the remedy granted. Santobello, at 267-69 (Marshall, J., dissenting). This was thus the opinion of the majority of the 7-member Court at that time.
[3]  In several cases, courts have ordered that promises a prosecutor had no legal authority to make should be enforced. See Palermo v. Warden, 545 F.2d 286, 296 (2d Cir.1976), cert. dismissed, 431 U.S. 911 (1977), and cases cited therein; Commonwealth v. Zuber, 466 Pa. 453, 353 A.2d 441 (1976). But in none of these cases did enforcement violate positive law. Indeed, even courts taking an expansive view of defendants' rights under plea agreements have refused specific performance when enforcement would be unlawful. See, e.g., People v. World, 121 Misc.2d 148, 467 N.Y.S.2d 978 (Sup. Ct. 1983).
[4]  There is no evidence that Miller compromised any of his constitutional rights after entering his plea. See People v. Carter, 134 Misc.2d 878, 886, 513 N.Y.S.2d 331 (Sup. Ct. 1987).
[5]  Indeed, in its original formulation, the "defendant's choice" approach was written narrowly, to apply only when the validity of a plea has been impaired by the prosecutor's breach of a plea agreement. Santobello v. New York, 404 U.S. 257, 267, 30 L.Ed.2d 427, 92 S.Ct. 495 (1971) (Douglas, J., concurring); see State v. Pope, 17 Wn. App. 609, 614, 564 P.2d 1179 (defendant's choice of remedy to be given weight "where bad faith is found to exist"), review denied, 89 Wn.2d 1009 (1977).
