
732 So.2d 444 (1999)
Michael CATINELLA, Appellant,
v.
STATE of Florida, Appellee.
No. 98-2302.
District Court of Appeal of Florida, Fourth District.
May 5, 1999.
*445 Richard L. Jorandby, Public Defender, and Sophia Letts, Assistant Public Defender, West Palm Beach, for appellant.
Robert A. Butterworth, Attorney General, Tallahassee, and Don M. Rogers, Assistant Attorney General, West Palm Beach, for appellee.
SHAHOOD, J.
Michael Catinella, pled no contest to the charges of exploitation of an elderly or disabled adult by one in a position of trust, grand theft, and uttering a forged instrument. He now appeals his sentence. We reverse and remand appellant's sentence with directions to the trial court to allow appellant to withdraw his plea.
At the plea hearing before the original trial judge, the following exchange took place:
[THE STATE]: He has a total points of forty-point six, which would be twelve point six state prison months.
THE COURT: All right. You understand that you'redespite the fact that there's a joint recommendation you're pleading straight up to the Court.
MR. CATINELLA: Yes sir.
THE COURT: You understand that that would mean that if theis that the maximum guidelines or the mid guidelines?
[THE STATE]: It would be the mid.
THE COURT: What's the maximum?
[THE STATE]: The maximum would be fifteen point seven five.
THE COURT: All right. You understand that your sentence could be up to fifteen point seven months in the Department of Corrections?
MR. CATINELLA: Yes sir.
Appellant's plea was based on a sentencing guidelines scoresheet reflecting 40.6 points. The written plea bears a notation by the trial judge that the sentence "can be anything within the guidelines."
Thereafter, at the sentencing hearing before another judge, appellant was sentenced based on another sentencing guidelines scoresheet. Appellant's counsel, who had not previously seen or had a chance to go over the new scoresheet, had appellant look at it for "half a minute" during the sentencing hearing and stated to the court that they had no corrections. The trial judge then denied appellant's request to withdraw his plea and sentenced appellant to thirty-one months on all counts, running concurrently, with credit for time served.
Section 3.170(f), Florida Rules of Criminal Procedure (1998) provides that "[t]he court may in its discretion, and shall on good cause, at any time before a sentence, permit a plea of guilty to be withdrawn." If there is a showing of good cause, the defendant shall be allowed to withdraw his plea as a matter of right; upon a showing of less than good cause, withdrawal of the plea is within the court's discretion. Yesnes v. State, 440 So.2d 628, 634 (Fla. 1st DCA 1983). The rule should be liberally construed in favor of the defendant. Id. The law favors a trial on the merits; therefore, where the interests of justice would be served, the defendant should be permitted to withdraw his plea. Id.
It is well settled that a plea of guilty or nolo contendere should be entered voluntarily by one who is competent to know the consequences, and should not be induced by fear, misapprehension, undue persuasion, promises, mistake, fraud, inadvertence or ignorance. State v. Braverman, 348 So.2d 1183, 1186 (Fla. 3d DCA 1977), cert. denied, 358 So.2d 128 (Fla. 1978). The courts of this state have expressly held that not only erroneous advice by defense counsel, but also statements by the trial judge that mislead a defendant into pleading when he would not otherwise have done so may require that leave be given to withdraw a plea. See, e.g., Leto v. *446 State, 658 So.2d 1108 (Fla. 4th DCA 1995)(appellant would be entitled to withdraw his plea if he could prove that the trial judge's statements regarding the probable length of time appellant would likely serve on a proposed sentence were misleading); Mantle v. State, 592 So.2d 1190 (Fla. 5th DCA 1992)(where all parties were mistaken as to the maximum sentence, and the plea agreement was based on the misunderstanding, appellant should have been allowed to withdraw his plea); Edwards v. State, 575 So.2d 297 (Fla. 4th DCA 1991)(where, due to error in calculating the scoresheet, sentencing judge was unable to comply with the plea agreement by imposing the recommended 12-year prison sentence, appellant should have been advised that he could withdraw his plea); Babbs v. State, 561 So.2d 1320 (Fla. 4th DCA 1990)(defendant allowed to withdraw plea where plea bargain was based on premise that guideline sentence would be less than later revealed by the presentence investigation, even where the defendant had misled the court about his prior record); Goldberg v. State, 536 So.2d 364 (Fla. 2d DCA 1988)(where the plea agreement was based on appellant's misrepresentation of no prior criminal record and subsequent presentence investigation revealed substantial prior criminal record, appellant should have been informed that he could withdraw his guilty plea).
In this case, the plea agreement was based on an improperly calculated scoresheet. When the properly calculated scoresheet was submitted to the sentencing judge, the judge should have informed appellant that the plea agreement could not be honored, and allowed appellant to withdraw his plea of no contest and proceed to trial.
Reversed and remanded with directions.
WARNER, J., and CHAVIES, MICHAEL B., Associate Judge, concur.
