
533 N.W.2d 678 (1995)
STATE of North Dakota, Plaintiff and Appellee,
v.
Reginald TRIEB, Defendant and Appellant.
Crim. No. 940399.
Supreme Court of North Dakota.
June 27, 1995.
*679 Jeff Rotering, State's Atty., Hettinger, for plaintiff and appellee.
David F. Senn, Senn Law Office, Dickinson, for defendant and appellant. Appearance by Reginald Trieb.
VANDE WALLE, Chief Justice.
Reginald Trieb appealed from a judgment on a guilty plea in the district court, Southwest Judicial District, finding him guilty of murder, a Class AA felony, and sentencing *680 him to thirty years in the North Dakota State Penitentiary. We affirm.
A jury convicted Trieb of murder, a Class AA felony, and Trieb was sentenced to life imprisonment. On appeal, this court reversed and remanded for a new trial. State v. Trieb, 315 N.W.2d 649 (N.D.1982) [Trieb I]. On remand, Trieb reached a plea agreement with the state and entered a plea of guilty. Trieb was sentenced to twenty-one years in the state penitentiary "without any reduction for good time." The court considered this to be a mandatory sentence "equal to a sentence of thirty years less good time."
On June 25, 1993, as a result of Trieb's motions for post-conviction relief, the district court amended the judgment of sentence. In State v. Trieb, 516 N.W.2d 287, 292 (N.D.1994) [Trieb II], we set aside the amended sentence as illegal because "[t]he sentencing court was outside its jurisdiction when it, in effect, guaranteed good time on a 30 year sentence by sentencing Trieb to 22 years, while placing limitations on accrual and application of good time." We recognized that the granting or withholding of good time were tools provided by the legislature to the Department of Corrections to be used for the enhancement of prison discipline. Id. Thus, we decided that good time was outside the province of sentencing courts and that a defendant could not waive good time for the purpose of plea bargaining. Id. We reversed and remanded "to the district court to amend the sentence to allow for good time, or to allow Trieb to withdraw his guilty plea." Id. at 292. Compare State v. Woods, 173 Wis.2d 129, 496 N.W.2d 144, 150 (Ct.App.1992) ["Assuming that the prosecution will resume, Woods now has three choices: plead guilty after negotiating another plea agreement; plead guilty in the absence of a plea agreement; or, go to trial."].
On remand, the trial court informed Trieb that he could withdraw his guilty plea and go to trial and advised him of his rights to counsel, to confrontation, and to a jury trial. The court also informed Trieb that if he persisted in his guilty plea, he would waive his rights of confrontation and trial by jury. It further advised that if Trieb did not withdraw his guilty plea, he could be sentenced to the maximum sentence permitted by statute, life imprisonment. Trieb declined to withdraw his guilty plea.
On sentencing, the trial court noted the violent nature of the crime and Trieb's behavior since the crime. It noted that Trieb's earning of a bachelor's degree and his seeking and following through with drug and alcohol counseling had some meaning. It then sentenced Trieb to thirty years in the state penitentiary with credit for time served and ordered that "[a]ny good-time credit and other credits and privileges earned during his incarceration to-date and granted by the North Dakota State Penitentiary and the North Dakota Parole Board shall be reinstated at the discretion of the entities granting the same."
On appeal, Trieb relies in large part on arguments disposed of in Trieb II, supra. In so doing, he mistakenly maintains that in Trieb II we left the trial court with only one option should Trieb decline to withdraw his guilty plea, i.e., to allow for good time on the twenty-two year sentence. We disagree.
Courts may only change sentences pursuant to the authority and limitations of Rule 35, N.D.R.Crim.P. State v. Bryan, 316 N.W.2d 335 (N.D.1982). Under Rule 35(a), "[t]he sentencing court may correct an illegal sentence at any time." Courts generally may correct an illegal sentence even if the correction results in a harsher sentence for the defendant. Bozza v. United States, 330 U.S. 160, 67 S.Ct. 645, 91 L.Ed. 818 (1947); United States v. Contreras-Subias, 13 F.3d 1341 (9th Cir.1994). See also United States v. Guevremont, 829 F.2d 423, 428 (3d Cir.1987) ["[W]here the sentencing judge's intention is clear, an increase of the sentence to make it conform with that intention is constitutional."]. Accord United States v. Minor, 846 F.2d 1184 (9th Cir.1988) [distinguishing the correcting of illegal sentences from other Rule 35 decisions which invoke constitutional concerns].
"Where the defendant has entered a guilty plea pursuant to a plea bargain contemplating a particular sentence, the general rule is that the defendant is entitled to withdraw the plea if it is subsequently determined that the *681 sentence is illegal or unauthorized." Christopher Vaeth, Annotation, Guilty Plea As Affected By Fact That Sentence Contemplated By Plea Bargain Is Subsequently Determined To Be Illegal Or Unauthorized, 87 A.L.R.4th 384, 388 (1991); Trieb II, supra; United States v. Johnson, 973 F.2d 857 (10th Cir.1992); State v. Price, 715 P.2d 1183 (Alaska Ct.App.1986); Gray v. United States, 585 A.2d 164 (D.C.1991); Sinn v. State, 609 N.E.2d 434 (Ind.Ct.App.1993); People v. Cameron, 193 A.D.2d 752, 597 N.Y.S.2d 724 (1993); People v. Clark, 176 A.D.2d 1206, 576 N.Y.S.2d 704 (1991); People v. West, 80 A.D.2d 680, 436 N.Y.S.2d 424 (1981); Hern v. State, 862 S.W.2d 179, 181 (Tex.Ct.App.1993) ["When a defendant successfully repudiates a plea bargain, either by withdrawing the plea or by successfully challenging his conviction on appeal, there is no double jeopardy obstacle to restoring the defendant and the State to the relationship that existed prior to the defunct bargain."].
However, "[s]ome courts have determined that providing the defendant with an opp[o]rtunity to withdraw the plea may be unnecessary if the illegal sentence can be reconciled with the plea bargain or otherwise corrected so as to give the defendant the benefit of the bargain." Christopher Vaeth, Annotation, supra, at 388. E.g., State v. Cabanas, 552 So.2d 1040 (La.Ct.App.1989).
After Trieb declined to withdraw his guilty plea, the resentencing left him with the benefit of his plea bargain. The transcript of the original sentencing hearing reveals that all of the parties understood that "the sentence of 22 years is the equivalent of the 30 year requirement of the statute." The text of the sentence which Trieb agreed to stated that Trieb "shall serve twenty-one years in the State Penitentiary and said twenty-one years shall not be reduced by good time credit, such twenty-one year sentence being equal to a sentence of thirty years less good time." Thus, the resentencing of Trieb to thirty years with the allowance of good time maintains the intent of the original plea bargain. Accord People v. Herrington, 136 A.D.2d 871, 524 N.Y.S.2d 530, 531 (1988) ["Given the clear intent of the prior sentence, ... County Court quite correctly resentenced defendant to the statutorily permissible indeterminate minimum term it did, that being the only lawful sentence available to the court that would achieve the intended result."].
Because Trieb's sentence was not increased, it is not necessary to decide all of the constitutional issues he raises. Nevertheless, we note: "When a second sentence imposed on resentencing is more severe than the original sentence, the relevant double jeopardy analyses requires that we ask whether the defendant had a legitimate expectation of finality in his original sentence." United States v. Rourke, 984 F.2d 1063, 1066 (10th Cir.1992). "A defendant cannot acquire a legitimate expectation of finality in a sentence which is illegal, because such a sentence remains subject to modification." Id. "Only in the extreme case can a court properly say that the later upward revision of a sentence, made to correct an earlier mistake, is so unfair that it must be deemed inconsistent with fundamental notions of fairness embodied in the Due Process Clause." DeWitt v. Ventetoulo, 6 F.3d 32, 35 (1st Cir.1993). See also Alabama v. Smith, 490 U.S. 794, 109 S.Ct. 2201, 104 L.Ed.2d 865 (1989); North Carolina v. Pearce, 395 U.S. 711, 89 S.Ct. 2072, 23 L.Ed.2d 656 (1969).
"[T]here is no single touchstone for making this judgment, nor any multi-part formula. Rather, drawing on considerations mentioned by cases like Breest [v. Helgemoe, 579 F.2d 95 (1st Cir.1978),] and suggested by common sense, we think that attention must be givenour list is not exclusiveto the lapse of time between the mistake and the attempted increase in sentence, to whether or not the defendant contributed to the mistake and the reasonableness of his intervening expectations, to the prejudice worked by a later change, and to the diligence exercised by the state in seeking the change."
DeWitt, supra, at 35.
The defendant's interests in finality must be weighed against the state's interest in the correction of the mistake. Id. The probability of a court resentencing in a vindictive manner after a defendant successfully appeals or petitions for post-conviction relief *682 must also be weighed. Alabama v. Smith, supra; North Carolina v. Pearce, supra.
Trieb's counsel stated at oral argument that with good time, Trieb could be released as early as June of 1999. This means that Trieb would serve less than twenty years from his original incarceration in November 1979. Thus, he could serve less time than he agreed to serve during his plea bargaining. If, at some future date, Trieb can show actual prejudice from the action which imposed a legal sentence, the courts can then give his claim the consideration it merits. E.g., United States v. Lopez, 706 F.2d 108 (2d Cir.1983).
We affirm.
MESCHKE, LEVINE and NEUMANN, JJ., concur.
SANDSTROM, Justice, specially concurring.
Although I believe this Court's earlier decision was wrong, see State v. Trieb, 516 N.W.2d 287 (N.D.1994) (Sandstrom, J., dissenting), I believe this decision correctly interprets that decision.
