
892 So.2d 1169 (2005)
Martin Haynes NICOL, Appellant,
v.
STATE of Florida, Appellee.
No. 5D04-503.
District Court of Appeal of Florida, Fifth District.
February 4, 2005.
*1170 James S. Purdy, Public Defender, and Allison Havens, Assistant Public Defender, Daytona Beach, for Appellant.
Charles J. Crist, Jr., Attorney General, Tallahassee, and Robin Compton, Assistant Attorney General, Daytona Beach, for Appellee.
PALMER, J.
Martin Nicol (defendant) appeals his judgment and sentence, arguing that the trial court erred in denying his motion to withdraw his guilty plea. Concluding that the trial court applied the wrong standard in denying the defendant's motion, we reverse.
The defendant was originally arrested on a charge of loitering and prowling. The State later charged the defendant with committing the crime of conspiracy to commit robbery. The defendant entered a plea of guilty to the charge. The trial court accepted the plea and then deferred sentencing. However, before the sentencing hearing took place, the defendant filed a motion to withdraw his plea.
In the motion, the defendant alleged that his plea was not entered voluntarily because at the time he entered the plea he had been advised by defense counsel that incriminating statements which had been made by the defendant to the police would be used against him at trial, and he had not been advised that said statements were subject to possible suppression based upon a claim that his arrest was unlawful. The claim that his arrest was illegal was based upon the law expressed in D.L.B. v. State, 685 So.2d 1340 (Fla. 2d DCA 1996), a case which recognizes that the loitering and prowling statute, section 856.021 of the Florida Statutes, requires the police, before effectuating an arrest, to afford the arrestee an opportunity to dispel any alarm or immediate concern which would otherwise be warranted by requesting him to identify himself and explain his presence and conduct.
The trial court conducted an evidentiary hearing on the defendant's motion. At the *1171 hearing, the defendant supported the statements which were set forth in his motion. His defense counsel also testified and confirmed that he never advised the defendant that the confession might be subject to suppression. Counsel admitted that he was not aware of the D.L.B. case (which would support an argument that the defendant's arrest was illegal and therefore his post-arrest statements were subject to suppression based upon the theory that they were "fruit of the poisonous tree." See Wong Sun v. U.S., 371 U.S. 471, 83 S.Ct. 407, 9 L.Ed.2d 441 (1963)). The arresting officer then testified as to the circumstances surrounding the defendant's arrest.
The trial court denied the defendant's motion, analyzing the matter in terms of whether the defendant had demonstrated that his defense counsel's performance was deficient. The court concluded that since a motion to suppress would likely have been denied, defense counsel's performance was not deficient. The defendant challenges this ruling contending that the trial court utilized the wrong standard in denying his motion. We agree.
Rule 3.170(f) of the Florida Rules of Criminal Procedure governs the circumstances under which a defendant can seek to withdraw a plea. The rule authorizes trial courts to grant a defendant's request to withdraw his plea at any time before sentencing in the court's discretion, but at the same time requires the court to grant such relief upon a showing of good cause:
Rule 3.170. Pleas
* * *
(f) Withdrawal of Plea of Guilty. The court may in its discretion, and shall on good cause, at any time before a sentence, permit a plea of guilty to be withdrawn and, if judgment of conviction has been entered thereon, set aside the judgment and allow a plea of not guilty, or, with the consent of the prosecuting attorney, allow a plea of guilty of a lesser included offense, or of a lesser degree of the offense charged, to be substituted for the plea of guilty. The fact that a defendant may have entered a plea of guilty and later withdrawn the plea may not be used against the defendant in a trial of that cause.
(Emphasis added). Our courts have consistently ruled that "[r]ule 3.170(f) should be liberally construed in favor of the defendant as the law favors a trial on the merits." Williams v. State, 762 So.2d 990 (Fla. 4th DCA 2000); Gray v. State, 754 So.2d 107 (Fla. 4th DCA 2000).
Here, the defendant is not challenging the trial court's exercise of discretion, but instead, he argues that, as a matter of law, the trial court was required to permit him to withdraw his plea because he demonstrated good cause.
The burden is upon the defendant to establish good cause. Robinson v. State, 761 So.2d 269 (Fla.1999); Taylor v. State, 870 So.2d 72 (Fla. 2d DCA 2003). Good cause exists in situations where the defendant demonstrates that his guilty plea was infected by misapprehension, undue persuasion, ignorance, was entered by one not competent to know its consequence, the ends of justice would be served by withdrawal of such plea or that it was otherwise involuntary. Onnestad v. State, 404 So.2d 403 (Fla. 5th DCA 1981). A defendant's entry of a plea based upon his attorney's mistaken advice can be a valid basis for finding good cause. See Graham v. State, 779 So.2d 604 (Fla. 2d DCA 2001)(holding that counsel's mistaken advice that defendant's photo would not be placed on the internet established good cause for permitting defendant to withdraw his guilty plea).
Here, the defendant's claim of good cause is premised upon his position that his trial counsel failed to give him any *1172 advice regarding the possibility of suppressing his pre-trial confession based upon an argument that his arrest was illegal. The trial court rejected the defendant's argument and refused to permit him to withdraw his plea, explaining that relief was not warranted because the defendant failed to demonstrate that, if filed, a motion to suppress would have been granted. In effect, the trial court concluded that, since the defendant could not prove that a pre-trial suppression motion would have been successful, the defendant was not entitled to withdraw his plea. In so ruling, the trial court applied the incorrect legal analysis. In analyzing the defendant's request to withdraw a plea, the court was required to focus on whether the defendant had demonstrated that his guilty plea was infected by misapprehension or ignorance.
The record established that the defendant presented evidence that (1) his defense counsel admitted that he never discussed the issue of filing a suppression motion with him before the plea was entered, and (2) the defendant would not have entered a plea had he been advised that there was a potential basis to challenge the legality of his arrest and the admissibility of his confession. Such evidence constitutes good cause sufficient to permit the defendant to withdraw his plea. Accordingly, the trial court should have granted the defendant's request to withdraw his plea.
The defendant's judgment and sentence are vacated and this matter remanded to the trial court with instructions to permit the defendant to withdraw his plea.
VACATED and REMANDED.
ORFINGER and TORPY, JJ., concur.
