
592 So.2d 1190 (1992)
William Chad MANTLE, Appellant,
v.
STATE of Florida, Appellee.
No. 91-688.
District Court of Appeal of Florida, Fifth District.
January 17, 1992.
*1191 James B. Gibson, Public Defender, and Brynn Newton, Asst. Public Defender, Daytona Beach, for appellant.
Robert A. Butterworth, Atty. Gen., Tallahassee, and Robin Compton Jones, Asst. Atty. Gen., Daytona Beach, for appellee.
W. SHARP, Judge.
Mantle appeals from his convictions and sentences for sexual battery[1] and burglary[2] on the ground that the trial court erred by not allowing him to withdraw his nolo contendere pleas at the sentencing hearing where the trial court imposed sentences grossly in excess of the state's recommendations. The record in this case supports Mantle's position.
At the plea hearing, Mantle pled nolo contendere to sexual battery not likely to cause personal injury, a lesser charge than the crime with which he was charged in the information (sexual battery by multiple perpetrators, §§ 794.011(5) & 794.023(2), Fla. Stat. (1989)). The plea agreement recited the judge made no promise as to his sentence and the prosecutor agreed to recommend that Mantle be sentenced under the Youthful Offender Act, with a maximum possible sentence of six years in prison. In an additional paragraph, the agreement provided: "I understand my sentences will be imposed under the Sentencing Guidelines. A presumptive sentence will be determined based upon certain factors. The Court can exceed this presumptive sentence and impose up to the maximum of 6 years FSP by stating clear and convincing reasons. If the Sentencing Guidelines range is exceeded I will have the right to appeal my sentence." (emphasis supplied)
In addition, at the same plea hearing, Mantle pled nolo contendere to burglary of a dwelling, a second degree felony, which was a lesser offense than the one with which he had been charged in the information: burglary of a dwelling while armed (§ 810.02(2)(b), Fla. Stat.). The plea agreement recited that the prosecutor would recommend ten years probation consecutive to the sexual battery sentence but the judge was not bound by the state's recommendation. It also provided: "I understand my sentence will be imposed under the Sentencing Guidelines. A presumptive sentence will be determined based upon certain factors. The Court can exceed this presumptive sentence and impose up to the maximum of 15 years FSP by stating clear and convincing reasons. If the Sentencing Guidelines range is exceeded I will have the right to appeal my sentence." (emphasis supplied).
At the plea hearing, the trial judge did not enter into a plea colloquy with Mantle. Defense counsel told the judge that Mantle had read the plea bargain forms and understood them. He reiterated that the maximum sentence for the sexual battery was 6 years as a youthful offender and 15 years for the burglary. Immediately thereafter, Mantle signed the plea agreements in open court. The trial judge accepted the pleas of nolo contendere to the two lesser charges and ordered a presentence investigation.
*1192 At the sentencing hearing, defense counsel asked that Mantle be sentenced consistent with the state's recommendations. He said that if the court chose not to sentence Mantle consistent with the state's recommendations, Mantle wished to withdraw his pleas. The trial court refused to allow Mantle to withdraw his pleas.
The trail judge noted that Mantle's scoresheet totalled 632 points  one of the highest he had ever seen. The recommended guidelines sentence was life and the permitted range was 27 years to life. When asked if he had anything to say, Mantle explained (rather inarticulately) that his prior offenses were committed as a juvenile and he did not understand he would be hit with that record and faced with a life term when he entered his nolo contendere pleas.
The trial judge said he had warned Mantle when he appeared before him in juvenile court that this would happen but Mantle obviously had not believed him. He said:
I am not going to allow you to withdraw your plea. Your pleas were freely and voluntarily made and they are even entered in writing on the record. I have never made any promises to you about what I would do except I promised you in Juvenile Court. I said it would be my pleasure if I saw you in the adult system to sentence you to the fullest extent that the law gave me the authority to do and I will do that.
The trial judge then sentenced Mantle to consecutive 15-year terms of incarceration, for a total of thirty years.
One problem with the sentences in this case and the judge's refusal to let Mantle withdraw his nolo contendere pleas is the judge's duty pursuant to Florida Rule of Criminal Procedure 3.171(d) to inform the defendant and the state that he cannot sentence pursuant to a presented plea bargain when he knows he cannot, prior to accepting the plea. Rule 3.171(d) provides that when the content of a plea bargain is made known to a trial judge before he accepts a plea and he learns of facts which make it impossible for him to sentence consistent with the plea bargain, he must so advise the parties before accepting the plea.[3] Logically, the trial judge must also advise the parties as to factors already known to him before accepting a plea.
In this case, the transcript suggests that the judge knew and remembered Mantle from juvenile court. He remembered having warned Mantle that Mantle would be sentenced to the maximum possible sentence in the adult system if he ever appeared before him there. He knew the plea bargain included the state's agreement to recommend that Mantle would be sentenced as a youthful offender with a 6 year maximum. But even then, without a presentence investigation, the transcript indicates this judge had no intention of treating Mantle as a youthful offender.
In addition, the record in this case clearly establishes that both the defense and the state were mistaken as to the impact of Mantle's prior criminal record on his scoresheet, and actual maximum sentences he was facing by entering a nolo contendere plea. Regarding the sexual battery charge, the plea agreement recited that the maximum sentence would be six years. Although not as misleading, the burglary plea agreement said that a fifteen year sentence would constitute an upward "departure sentence" under the guidelines for which written reasons would be required and Mantle would then have the right to appeal a 15 year sentence. Both statements were erroneous.
Many cases hold that a defendant may not withdraw a nolo contendere or guilty plea where there is no misunderstanding or mistake as to the plea bargain, and the state fulfills its obligations to recommend the agreed to sentence. See State v. Adams, 342 So.2d 818 (Fla. 1977); Green v. State, 580 So.2d 321 (Fla. 1st DCA 1991); *1193 Johnson v. State, 541 So.2d 1213 (Fla. 2d DCA 1989); Stewart v. State, 511 So.2d 375 (Fla. 1st DCA 1987); Little v. State, 492 So.2d 807 (Fla. 1st DCA 1986); Lepper v. State, 451 So.2d 1020 (Fla. 1st DCA 1984). However, if the record reveals a reasonable basis to conclude that a defendant was misled by a statement at the plea hearing made by the judge or by one or both of the attorneys (defense counsel or prosecutor) he should be permitted to withdraw his plea and go to trial. See Costello v. State, 260 So.2d 198 (Fla. 1972); Brown v. State, 245 So.2d 41 (Fla. 1971). See also State v. Viele, 559 So.2d 1304 (Fla. 4th DCA 1990) (defendant advised erroneously by his attorney that he would get gain time); Kirkman v. State, 559 So.2d 695 (Fla. 3d DCA), rev. denied, 574 So.2d 143 (Fla. 1990) (plea bargain contemplated defendant's eligibility for M.D.S.O. program but sentence imposed made him ineligible); Bullard v. State, 477 So.2d 655 (Fla. 2d DCA 1985) (trial attorney erroneously told defendant his maximum sentence would be 5 years; he was sentenced to 15 years); Dominquez v. State, 432 So.2d 799 (Fla. 2d DCA 1983) (there was "confusion" as to the plea bargain).
In this case, the record shows that Mantle, his counsel, and the prosecutor were all mistaken as to the maximum sentence for sexual battery and the applicable guidelines range for the burglary charge. The trial judge was orally told at the plea hearing what the parties thought the maximum sentences and guidelines range would be and the written agreement clearly manifests their misunderstandings. Under such circumstances, Mantle should have been allowed to withdraw his nolo contendere pleas.[4] A nolo contendere plea entered into with such a gross misunderstanding of the maximum sentence possibilities and the applicable guidelines range (here 27 years to life) cannot be reasonably construed as "voluntary."
Accordingly, we reverse the convictions appealed in this case, vacate the sentences and remand for further proceedings. Mantle should be offered the opportunity to withdraw both nolo contendere pleas. If he does so, the state may proceed to prosecute him for the more serious felony offenses charged in the informations for which he could receive life imprisonment.
REVERSED and REMANDED.
DAUKSCH, J., concurs.
GRIFFIN, J., concurs in result only.
NOTES
[1]  § 794.011(5), Fla. Stat. (1989).
[2]  § 810.02(3), Fla. Stat. (1989).
[3]  Florida Rule of Criminal Procedure 3.171(d) provides:

After an agreement on a plea has been reached, the trial judge may have made known to him the agreement and reasons therefor prior to the acceptance of the plea. Thereafter, he shall advise the parties of whether other factors (unknown at the time) may make his concurrence impossible.
[4]  See Babbs v. State, 561 So.2d 1320 (Fla. 4th DCA 1990) (plea bargain based on premise that guideline sentence would be less than later revealed by PSI); Goldberg v. State, 536 So.2d 364 (Fla.2d DCA 1988) (plea bargain entered into when all parties thought the guidelines sentence was probation; prior criminal record later revealed in PSI); Perry v. State, 510 So.2d 1083 (Fla. 2d DCA 1987) (defense counsel told defendant erroneously before trial judge that the guidelines sentence was 2 years, but after PSI it was 3 1/2 to 4 1/2 years).
