
437 So.2d 1079 (1983)
Dan FORBERT, Petitioner,
v.
STATE of Florida, Respondent.
No. 62302.
Supreme Court of Florida.
July 28, 1983.
Rehearing Denied October 10, 1983.
*1080 Alan H. Schreiber, Public Defender and T. Don Tenbrook, Asst. Public Defender, Seventeenth Judicial Circuit, Fort Lauderdale, for petitioner.
Jim Smith, Atty. Gen. and Stewart J. Bellus, Asst. Atty. Gen., West Palm Beach, for respondent.
BOYD, Justice.
This case is before the Court for review of the decision in Forbert v. State, 415 So.2d 96 (Fla. 4th DCA 1982). The district court certified four questions passed upon by the decision as being of great public importance. We have jurisdiction. Art. V, § 3(b)(4), Fla. Const.
Forbert pled guilty to a charge of robbery in exchange for a "split sentence" of five years imprisonment and three years' probation. He subsequently filed a motion pro se to correct his sentence on the authority of Villery v. Florida Parole and Probation Commission, 396 So.2d 1107 (Fla. 1981). The attorney appointed to represent Forbert at the hearing on the motion argued that resentencing Forbert to any term of imprisonment longer than five years would be a violation of Forbert's constitutional rights to be free from double jeopardy and of due process and would also be outside the limit on incarceration contemplated in the original plea agreement. Nevertheless the court resentenced Forbert to eight years in prison with credit for time served. On appeal the district court of appeal affirmed, certifying the following questions to be of great public importance:
1. In correcting a voidable sentence, is the maximum sentence that can be imposed imprisonment for a period of time not exceeding the total of the imprisonment and probation originally imposed? If not, what is the maximum sentence?
2. If the sentence imposed is imprisonment for a period of time not exceeding the total time of the imprisonment and probation originally imposed, can such sentence violate the prohibitions of [North Carolina v. Pearce, 395 U.S. 711, 89 S.Ct. 2072, 23 L.Ed.2d 656 (1969)]?
3. If compliance with Pearce is required under the circumstances set forth in 2. above, at what point does a sentence of imprisonment that replaces a sentence of a combination of imprisonment and probation become a more severe sentence subject to the limitations of Pearce?

4. If the original sentence was imposed pursuant to and as part of a negotiated plea, in resentencing a defendant upon a Villery motion to correct an illegal sentence can the trial court impose a longer sentence of imprisonment than originally imposed without giving the defendant *1081 an opportunity to withdraw his negotiated plea?
415 So.2d at 97-98.
The first three questions are identical to those answered by this Court in Beech v. State, 436 So.2d 82 (Fla. 1983), wherein we held that a judge in correcting a sentence rendered illegal by our decision in Villery may resentence the defendant to serve a term of imprisonment not longer than the combined terms of imprisonment and probation originally imposed without having to comply with the requirements of Pearce. As for the fourth question, we answer in the negative.
It is a well-established principle of law that a defendant should be allowed to withdraw a plea of guilty where the plea was based upon a misunderstanding or misapprehension of facts considered by the defendant in making the plea. Brown v. State, 245 So.2d 41 (Fla. 1971); Rubenstein v. State, 50 So.2d 708 (Fla. 1951). Hence when a defendant pleads guilty with the understanding that the sentence he or she receives in exchange is legal, when in fact the sentence is not legal, the defendant should be given the opportunity to withdraw the plea when later challenging the legality of the sentence. Cleveland v. State, 394 So.2d 230 (Fla. 5th DCA 1981); Britt v. State, 352 So.2d 148 (Fla. 2d DCA 1977). In Cleveland and Britt the defendants agreed to serve sentences exceeding the maximum sentences authorized for the crimes to which they pled guilty. Reasoning that the defendants had negotiated with a misunderstanding of the appropriate penalties, the courts ruled that the defendants were to be allowed to withdraw their pleas of guilty when challenging the illegal sentences. Cleveland went a step further and stated that the state could "exercise its option to accept the plea with the sentence reduced to a legal term." 394 So.2d at 230. See also Jolly v. State, 392 So.2d 54 (Fla. 5th DCA 1981). Jolly reasoned that since the state may not have witnesses or other evidence available in cases where a defendant moves to withdraw his plea months or years after entering it, the state should have the option of either agreeing that the judgment and sentence should both be vacated or holding the defendant to his plea of guilty and vacating only the excessive portion of the sentence.
We agree with the reasoning of these decisions. In this case Forbert pled guilty with the understanding that the sentence he was to receive in exchange, five years' imprisonment followed by three years of probation, was statutorily authorized. Because "split sentences" of this type were declared illegal by our decision in Villery, Forbert had the right to have his sentence corrected so that it conformed to the law. When the judge indicated that he would resentence Forbert to eight years in prison, Forbert sought to withdraw his plea of guilty since such a sentence was not what he had bargained for. The court should then have either allowed Forbert to withdraw his plea, reinstating the charges originally filed against him, or should have resentenced him within the parameters of the plea agreement. He could have performed the latter by changing the term of incarceration exceeding one year to probation or by vacating the probation portion of the original sentence. Since Forbert, by moving to withdraw his plea of guilty, has indicated a desire to be no longer bound by the original plea agreement, if he renews his motion the state will also be released from its obligations under that agreement. Therefore if the court allows withdrawal of the plea the state can insist that the original charges be reinstated against Forbert. Peak v. State, 399 So.2d 1043 (Fla. 5th DCA 1981).
The trial court erred by denying Forbert's motion to withdraw his plea of guilty. We therefore remand this case with instructions that Forbert be allowed the opportunity to renew his motion to withdraw his plea of guilty. If the judge declines to conform the sentence of imprisonment to the limits of the original plea agreement, then the motion to withdraw plea should be granted.
It is so ordered.
*1082 ALDERMAN, C.J., and ADKINS, OVERTON and EHRLICH, JJ., concur.
McDONALD, J., concurs in result only.
