
963 So.2d 693 (2006)
Billy Dewayne WATERS
v.
STATE of Alabama.
CR-05-2108.
Court of Criminal Appeals of Alabama.
December 20, 2006.
Rehearing Denied February 16, 2007.
David Ray Pace, Anniston, for appellant.
Troy King, atty. gen., and John J. Davis, asst. atty. gen., for appellee.
BASCHAB, Judge.
The appellant, Billy Dewayne Waters, pled guilty to third-degree robbery, a violation *694 § 13A-8-43(a)(1), Ala.Code 1975. The trial court sentenced him, as a habitual offender, to serve a term of twenty years in prison. See § 13A-5-9 (c)(1), Ala. Code 1975. The appellant filed a motion to withdraw to his guilty plea, which the trial court denied. This appeal followed.
The appellant argues that the trial court erroneously denied his motion to withdraw his guilty plea. Specifically, he contends that the trial court should have allowed him to withdraw his guilty plea after it did not sentence him in accordance with the plea agreement in this case. Rule 14.3, Ala. R.Crim. P., provides, in pertinent part:
"(b) Disclosure of Plea Agreement. If a plea agreement has been reached by the parties, the court shall require the disclosure of the agreement in open court prior to the time a plea is offered. Thereupon, the court may accept or reject the agreement or may defer its decision as to acceptance or rejection until receipt of a presentence report.
"(c) Acceptance or Rejection of Plea Agreements.
". . . .
"(2) If the court rejects the plea agreement, the court shall:
"(i) So inform the parties;
"(ii) Advise the defendant and the prosecutor personally in open court that the court is not bound by the plea agreement;
"(iii) Advise the defendant that if the defendant pleads guilty, the disposition of the case may be either more or less favorable to the defendant than that contemplated by the plea agreement;
"(iv) Afford the defendant the opportunity to withdraw the defendant's offer to plead guilty;
"(v) Afford the prosecutor the opportunity to change his recommendations; and
"(vi) Afford the parties the opportunity to submit further plea agreements."
Rule 14.4(e), Ala. R.Crim. P., provides:
"The court shall allow withdrawal of a plea of guilty when necessary to correct a manifest injustice."
"Whether a defendant should be allowed to withdraw a plea of guilty is a matter solely within the discretion of the trial court, whose decision will not be disturbed on appeal absent a showing of abuse of that discretion." Alford v. State, 651 So.2d 1109, 1112 (Ala.Crim.App.1994).
In this case, the appellant and the State entered into a plea agreement in which the appellant admitted that he had two prior felony convictions and the State agreed to recommend a ten-year sentence split to serve a term of one year. On March 30, 2006, the appellant entered his guilty plea, and the trial court scheduled a sentencing hearing for May 9, 2006. During the hearing on May 9, 2006, the following occurred:
"THE COURT: Billy Waters. Okay, Mr. Waters entered a guilty plea in this case to Robbery Third Degree, a Class C felony. That plea was entered on March 30th, sentencing this date. [Prosecutor], does the State have anything?
"[PROSECUTOR]: Nothing, Your Honor, but the fact that the defendant entered an open plea during the middle of the trial week. At the time, the State placed on the record its recommendation of a 10-year sentence, split to one. And the time from that time, Judge, we have learned that we made that recommendation on the basis of the wrong belief he had two prior felony convictions. We now know that he has more than three *695 prior felony convictions. At a minimum, he has three prior felony convictions, perhaps up to five.
"Therefore, Judge, the State's recommendation that we placed on the record would be an illegal recommendation to the Court. By your probation report, Mr. Waters, I see at least four prior felony convictions, plus some other cases in Georgia that show no disposition.
"MS. THOMAS: On the bottom of page 3 where it says, `One year,' Sue Frazier of the DA's office confirmed that would be considered a felony in Georgia, arrest date of 7/21/01, possession of a firearm by a convicted felon.
"THE COURT: Mr. Waters, you represented to the Court when you entered your guilty plea that you had two prior felonies: An arson charge and a controlled substance offense in 1992. Now, you did enter a plea of guilty to the charge contained in the indictment. The punishment range was explained to you based on your representation as to your prior record, but with three or more prior felony convictions, the minimum sentence in Alabama becomes 15 years, the maximum sentence becomes life or 99 years, the maximum fine becomes $20,000. You have still pled guilty to the charge. The only difference is the available punishment range.
"I will leave it up to you. You can either withdraw your guilty plea at this time or you may proceed to sentencing with that explanation in mind that you have those prior felonies.
"Now, if you do not have three or more prior felonies, you need to speak now and let us know that, and then, of course, it will be incumbent upon the State to prove those at sentencing. The choice is yours, sir.
"[DEFENSE COUNSEL]: Mr. Waters says he's still of the opinion that he has only two felony convictions, and he's not
"THE COURT: I'll reset your sentence hearing for June 28th. The State will file a notice of its intent to proceed against you for sentencing as a habitual felony offender. They will give a statement to you of the charges they expect to prove at sentencing. If they prove those charges, then I will proceed with sentencing; okay? If they do not, we'll stand where we are. Anything further?
"(END OF PROCEEDINGS)"
(R. 14-16.)
On June 28, 2006, the trial court conducted a sentence hearing. During that hearing, the State introduced certified copies of three prior felony convictions from the State of Alabama and asserted that the appellant had two felony convictions from the State of Georgia. Afterward, the following occurred:
"[DEFENSE COUNSEL]: Mr. Waters would ask permission to withdraw his earlier plea based on
"THE COURT: I thought I gave him that opportunity over a month ago?
"[DEFENSE COUNSEL]: You did, Your Honor.
"THE COURT: And he said he did not wish to withdraw it. He said he wished to proceed with sentencing.
"[DEFENSE COUNSEL]: Yes, sir.
"THE COURT: I offered that to him on the 9th of May.
"[DEFENSE COUNSEL]: Right. Yes, sir, Judge, and that's what he related to me is that was his understanding about the felony situation, and given the fact that it's been clearly identified, he would like to move to withdraw his plea.
"[DEFENSE COUNSEL]: Your Honor, if the Court could refer to State's Exhibit Three, the certified copy of his conviction from Jefferson County, I believe *696 in that plea hearing, they sentenced him as a two-time offender in that circuit. So at least in 2004, I can only assume it was brought to the defendant's attention that he had at least two prior felonies.
"And also, Judge, the State is going to note that the defendant has been revoked  his probation has been revoked in Jefferson County on that case. His case is currently pending revocation in Jefferson County.
"THE COURT: Mr. Waters, you've been previously offered by the Court to withdraw your guilty plea. You elected not to do so. You wanted to proceed to sentencing. Your oral motion to withdraw at this point is denied."
(R. 23-24.) The trial court then sentenced the appellant to serve a term of twenty years in prison.
This court addressed a similar situation in Edwards v. State, 581 So.2d 1260, 1261 (Ala.Crim.App.1991), as follows:
"Edwards also contends that the trial court erred when it failed to sentence him in accordance with a plea bargain agreement, and, thereafter, denied his motion to withdraw his guilty plea. The plea agreement stipulated that if he would plead guilty to the charged offense, the state would recommend, in concurrence with the warden of the Department of Corrections, that Edwards be sentenced, under the Habitual Felony Offender Act, for having two prior felony convictions, to a 10-year prison sentence to run concurrently with the prison sentence he is presently serving. The trial court accepted Edwards's guilty plea, but sentenced him to 30 years' imprisonment after discovering from the pre-sentence report that he had four prior felony convictions. Edwards, thereafter, timely filed a motion to withdraw his guilty plea.
"`[I]f there is a plea agreement between a defendant and the State and a breach thereof which is made known to the trial court, and if the trial court does not sentence the defendant pursuant to the terms of the plea agreement (or as alleged in the instant case, that the State makes a sentence recommendation contrary to the plea agreement), then the defendant must be given an opportunity, upon proper, timely, and specific motion, to withdraw his guilty plea. At that point, the trial court must review the circumstances surrounding the making of the plea agreement and determine whether . . . a breach occurred. Further, it must decide if the guilty plea rested in any significant degree upon the agreement of the State, so that such can be said to be part of the inducement or consideration and, thus, must be fulfilled. The trial court may hold a hearing and receive testimony to determine the above. Once it makes its findings, the trial court then determines the appropriate remedy, if any. Santobello v. New York, 404 U.S. 257 [92 S.Ct. 495, 30 L.Ed.2d 427] . . . (1971); See [Ex parte] Yarber [, 437 So.2d 1330 (Ala. 1983)].'
"Orr v. State, 435 So.2d 182, 184 (Ala.Cr. App.1983). See also Ex parte Otinger, 493 So.2d 1362 (Ala.1986); Blackwell v. State, 556 So.2d 1091 (Ala.Cr.App.1988); English v. State, 56 Ala.App. 704, 325 So.2d 211 (Ala.Cr.App.1975), cert. denied, 295 Ala. 401, 325 So.2d 216 (1976)."
In this case, the trial court informed the appellant that he could withdraw his guilty plea during the hearing on May 9, 2006. However, at that time, the appellant did not have complete information upon which to base his decision because he did not know if the State would be able to prove *697 that he had three prior felony convictions and did not know if the trial court would sentence him in accordance with the plea agreement. Once the State proved the three prior felony convictions and the trial court indicated that it was not going to sentence him in accordance with the plea agreement during the sentence hearing on June 28, 2006, the appellant had the necessary information upon which to base his decision.
At that time, the trial court should have afforded him the opportunity to withdraw his guilty plea. Therefore, the trial court abused its discretion when it denied the appellant's motion to withdraw his guilty plea. Accordingly, we reverse the trial court's judgment and remand this case to that court for proceedings that are consistent with this opinion.
REVERSED AND REMANDED.
McMILLAN, P.J., and COBB, SHAW, and WISE, JJ., concur.
