
6 So.3d 653 (2009)
Randal J. LUEDTKE, Appellant,
v.
STATE of Florida, Appellee.
No. 2D06-4580.
District Court of Appeal of Florida, Second District.
March 4, 2009.
*654 Jo Ann Barone, West Palm Beach, for Appellant.
Bill McCollum, Attorney General, Tallahassee, and Joseph Hwan-Yul Lee, Assistant Attorney General, Tampa, for Appellee.
*655 ALTENBERND, Judge.
Randal J. Luedtke appeals his judgment and sentence, challenging the court's denial of his presentence motion to withdraw plea. We agree with Mr. Luedtke that his trial counsel's incorrect advice regarding possible civil commitment consequences under the Jimmy Ryce Act[1] constituted good cause sufficient to permit Mr. Luedtke to withdraw his guilty plea prior to sentencing. We accordingly reverse and remand for further proceedings.
In February 2006, the State filed an amended information charging Mr. Luedtke with one count of sexual battery under section 794.011(5), Florida Statutes (2004). Mr. Luedtke entered a negotiated plea of no contest to the charge. The plea agreement called for a downward departure sentence of six years' imprisonment, which was scheduled to be imposed at a sentencing hearing approximately one month after the plea hearing.
During the plea colloquy, the court, in accordance with Florida Rule of Criminal Procedure 3.172(c)(9), asked Mr. Luedtke whether he understood that the Jimmy Ryce Act provides for evaluation and involuntary civil commitment of a person who has been convicted of a sexually motivated offense and who is found to be likely to commit a sexually motivated offense in the future. After the court's explanation, Mr. Luedtke provided no response. Mr. Luedtke's attorney then took a moment, off the record, apparently to clarify the matter with Mr. Luedtke. Mr. Luedtke then responded "[c]lear," and he confirmed to the court that he and his attorney had discussed the implications of the Jimmy Ryce Act. The court then accepted Mr. Luedtke's plea and granted Mr. Luedtke's request to defer sentencing to a later date.
Before sentencing, Mr. Luedtke obtained new counsel and moved to withdraw his plea under Florida Rule of Criminal Procedure 3.170(f). He claimed that his prior attorney had misadvised him about the consequences of the Jimmy Ryce Act. During an evidentiary hearing on the motion, Mr. Luedtke's prior attorney testified that he had advised Mr. Luedtke that the Jimmy Ryce Act probably would not apply to him. Mr. Luedtke also testified and recalled that his attorney told him not to worry about the Jimmy Ryce Act because he did not have any prior convictions. The trial court denied Mr. Luedtke's motion, reasoning that counsel's advice was reasonable and that if Mr. Luedtke were placed in Jimmy Ryce proceedings after completing his sentence, he could move to withdraw his plea at that time.
Under rule 3.170(f), the trial court may, in its discretion, and shall, on good cause, at any time before sentencing, permit a plea of guilty or no contest to be withdrawn. Where less than good cause is shown, the trial court's ruling will not be reversed absent an abuse of discretion. Smith v. State, 840 So.2d 404, 406 (Fla. 4th DCA 2003). If, however, there is a showing of good cause, the defendant shall be allowed to withdraw his plea as a matter of right. See id.; see also Wright v. State, 961 So.2d 1036, 1040 (Fla. 4th DCA 2007) ("[W]hen good cause is established, the rule entitles the defendant to withdraw the plea.").
Good cause to withdraw a plea has been found to exist "when the plea is 'infected by misapprehension, undue persuasion, ignorance, or was entered by one not competent to know its consequence or that it was otherwise involuntary, or that the ends of justice would be served by withdrawal of such plea.'" Johnson v. *656 State, 947 So.2d 1208, 1210 (Fla. 5th DCA 2007) (quoting Onnestad v. State, 404 So.2d 403, 405 (Fla. 5th DCA 1981)). Civil commitment of persons found to be sexual predators under the Jimmy Ryce Act is considered a collateral consequence of a plea to a qualifying offense. Watrous v. State, 793 So.2d 6, 10 (Fla. 2d DCA 2001). It is well settled that affirmative misadvice regarding collateral consequences of a plea forms a basis for allowing a defendant to withdraw the plea. Id. at 11.
Section 394.912(9)(d), Florida Statutes (2004), of the Jimmy Ryce Act defines "sexually violent offense" as including a "[s]exual battery in violation of s. 794.011." Under the Act, a person is subject to civil commitment proceedings if he or she has been convicted of a sexually violent offense and is sentenced to total confinement after the effective date of the Act, January 1, 1999. § 394.925.
Thus, based on the applicable law, Mr. Luedtke's no contest plea to the offense of sexual battery in 2006 and his resulting sentence of confinement rendered him subject to the provisions of the Jimmy Ryce Act. This is not a matter of probability, but a legal certainty. Moreover, without elaborating on the facts, this case does not involve a minor or technical violation of the statute where an attorney could advise his or her client that the State "probably" would opt not to bring such proceedings against him after he completed his six-year term of imprisonment. The quick advice given to Mr. Luedtke at the plea hearing was misadvice. See Colombo v. State, 972 So.2d 1101, 1102 (Fla. 1st DCA 2008) (holding defendant's claim of affirmative misadvice regarding consequences under the Jimmy Ryce Act established facially sufficient claim of ineffective assistance of counsel).
Moreover, the trial court erred in assuming that Mr. Luedtke could wait until he had nearly completed his term of imprisonment to bring a postconviction motion to withdraw his plea. Mr. Luedtke was not required to wait until civil commitment proceedings were brought against him to seek relief. Indeed, the normal period in which Mr. Luedtke could file a timely rule 3.850 motion would expire long before he completed his six-year prison sentence. See Fla. R.Crim. P. 3.850(b).
Counsel's affirmative misadvice regarding the applicability of the Jimmy Ryce Act provided good cause to support Mr. Luedtke's motion to withdraw his plea. We therefore conclude that the trial court erred in denying Mr. Luedtke's motion to withdraw plea, and we reverse and remand for further proceedings.
Reversed and remanded.
CASANUEVA and LaROSE, JJ., Concur.
NOTES
[1]  See §§ 394.910-.931, Fla. Stat. (2004).
