
    John Henry BROWN v. STATE.
    CR-99-0759.
    Court of Criminal Appeals of Alabama.
    June 30, 2000.
    Rehearing Denied July 21, 2000.
    James R. Bryant, Anniston, for appellant.
    John Henry Brown, appellant, pro se.
    Bill Pryor, atty. gen., and Robin Blevins, asst. atty. gen., for appellee.
   LONG, Presiding Judge.

Pursuant to a plea agreement, John Henry Brown pleaded guilty to robbery in the third degree, a violation of § 13A-8-43, Ala.Code 1975. The trial court sentenced Brown, as a habitual offender, to 25 years in prison.

On appeal, Brown contends that the trial court erred in denying his motion to withdraw his guilty plea. He argues that the trial court rejected the plea agreement he had reached with the State and then failed to allow him to withdraw his plea.

Brown was indicted for first-degree robbery, see § 13A-8-41, Ala.Code 1975. Subsequently, Brown entered a guilty plea to robbery in the third degree, based on a written negotiated plea agreement, pursuant to which the State agreed to recommend that Brown be sentenced, as a habitual offender, to 15 years in prison. At the guilty plea hearing, the trial court advised Brown that it was not bound by the terms of the plea agreement. After accepting Brown’s guilty plea, the trial court continued the case for presentence investigation. At Brown’s sentencing hearing, the trial court sentenced Brown, as a habitual offender, to 25 years in prison. Brown moved to withdraw his guilty plea on grounds that his plea was based on the State’s agreement to recommend a 15-year sentence and that if the trial court failed to sentence him in accordance with this term of the plea agreement, he did not wish to plead guilty. The trial court denied Brown’s motion to withdraw his guilty plea.

In its brief to this court, the State agrees with Brown’s contention that he should have been allowed to withdraw his guilty plea when the trial court failed to sentence him in accordance with the terms of the plea agreement. As this court stated in Bagley v. State, 681 So.2d 262 (Ala.Crim.App.1995):

“ ‘[T]he trial court is not bound to accept an agreement between the defense and the prosecution.’ Ex parte Yarber, 437 So.2d 1330, 1336 (Ala.1983). However, ‘ “[w]hen the trial judge decides not to carry out an agreement reached between the prosecutor and defense counsel, the accused must be afforded the opportunity to withdraw his or her guilty plea on motion promptly made.” ’ Bland v. State, 565 So.2d 1240, 1243 (Ala.Cr.App.1990), quoting Ex parte Otinger, 493 So.2d 1362, 1364 (Ala.1986).”

681 So.2d at 265. See also Rule 14.3(c)(2)(iv), Ala.R.Crim.P. Because the trial court, in effect, rejected the plea agreement in this case when it sentenced Brown to 25 years in prison, Brown should have been afforded the opportunity to withdraw his guilty plea. Thus, the trial court erred in denying Brown’s motion to withdraw his guilty plea. See Dalton v. State, 770 So.2d 650 (Ala.Crim.App.1999); and Moore v. State, 719 So.2d 269 (Ala.Crim.App.1998).

Accordingly, the judgment of the trial court is reversed and this cause is remanded for the trial court to allow Brown the opportunity to withdraw his guilty plea.

REVERSED AND REMANDED.

McMILLAN, COBB, BASCHAB, and FRY, JJ., concur. 
      
      . Rule 14.3(c)(2)(iv) provides: “If the court rejects the plea agreement, the court shall ... [ajfford the defendant the opportunity to withdraw the defendant’s offer to plead guilty.”
     