In this appeal, André Pagan challenges the circuit court’s summary denial of his numerous motions for postconviction relief. Pagan alleged claims in three broad categories: trial court error, ineffective assistance of counsel, and a Brady1 violation. We reverse the denial of his ineffective assistance claims and remand for an evi-dentiary hearing. His other claims have no merit, and we affirm them without further discussion.
A young boy who lived with Pagan and his companion, Isabel Feliciano, died while in their care. Pagan entered an open plea to a charge of aggravated child abuse with torture. See § 827.03(2) Fla. Stat. (2002). He apparently cooperated with law enforcement and testified against Feliciano, who actively caused the child’s death. Fel-iciano was eventually convicted of aggravated child abuse, and she was sentenced to ten years’ imprisonment followed by five years’ probation. At a sentencing hearing held after Feliciano’s trial, Pagan was sentenced to thirty years’ imprisonment. He filed a timely motion to withdraw his plea pursuant to Florida Rule of Criminal Procedure 3.170(7), alleging that his lawyers gave him misleading advice concerning his decision to enter the plea.
The circuit court appointed conflict-free counsel to assist Pagan with his rule 3.170(7) motion. An evidentiary hearing was scheduled, but just before the hearing was to begin the State offered Pagan an agreement to resolve the motion. The State would ask the court to reduce Pagan’s sentence to fifteen years’ imprisonment followed by ten years’ probation if Pagan would relinquish any rights he might have to seek collateral relief. The offer required Pagan’s immediate acceptance; if he did not agree, the offer would be rescinded and the evidentiary hearing would go forward. The court gave Pagan time to consult with his counsel, after which Pagan accepted the State’s offer. The court resentenced him to the lesser *5term and remarked to Pagan that “you would be agreeing that you will withdraw this motion to withdraw your plea and you will also be agreeing that you will not file any further post-conviction motions attempting to reduce this sentence that I am about to impose.” Later the court added: “And just to reiterate part of the deal is you will not be filing any more post-conviction motions. This — this is it. You filed it. It worked for you.”
After the resentencing, Pagan appealed his conviction and sentence, and this court affirmed. Since that time, Pagan has filed numerous motions for postconviction relief under Florida Rule of Criminal Procedure 3.850 based on his counsel’s alleged ineffective assistance in connection with the State’s offer to resolve his rule 3.170(0 motion. The postconviction court summarily denied these motions, citing Kokal v. State, 901 So.2d 766, 777 (Fla.2005), for its holding that a prisoner’s claim that he received ineffective assistance in a post-conviction proceeding is not cognizable.
But a rule 3.170(Z) motion is not a postconviction matter; it is a motion to withdraw the defendant’s plea filed before his conviction becomes final, and it is a critical stage of the proceedings. That being the case, a defendant moving to withdraw his plea under that rule is entitled to representation by counsel, and he is entitled to effective assistance from that counsel. See Krautheim v. State, 38 So.3d 802, 803-04 (Fla. 2d DCA 2010) (citing Daniel v. State, 865 So.2d 661, 661 (Fla. 2d DCA 2004)); see also Williams v. State, 959 So.2d 830, 832 (Fla. 4th DCA 2007) (Warner, J., concurring) (quoting Judge Altenbernd’s comment in a workgroup report on rule 3.170(i) that “[a]lthough a movant cannot allege ineffective assistance of counsel concerning representation on a motion under rule 3.850, since rule 3.170(1) is a critical stage of proceedings prior to direct appeal, presumably it can support a claim of ineffective assistance of counsel.” (citation omitted)). In the instant matter, the postconviction court seemed to misunderstand that Pagan’s claims of ineffectiveness concerned his representation on a rule 3.170(1) motion, not on a rule 3.850 motion. Thus its ruling that Pagan could not state a claim for relief based on the reasoning in Kokal was incorrect.
Before remanding this case to the circuit court, we must determine whether Pagan waived his right to assert this post-conviction claim when he accepted the State’s offer to resolve his rule 3.170(1) motion. We have held that “a defendant can waive his right to collaterally attack his judgment and sentence when the waiver is expressly stated in the plea agreement and he knowingly and voluntarily agrees to the waiver.” Stahl v. State, 972 So.2d 1013, 1015 (Fla. 2d DCA 2008) (citing Williams v. United States, 396 F.3d 1340, 1342 (11th Cir.2005)). But we specifically noted that “ineffective assistance of counsel claims attacking the advice received from counsel in entering into the plea and waiver cannot be waived.” Id. Accordingly, Pagan did not waive the claims he now asserts against his counsel in the rule 3.170(() proceeding.
We remand to the circuit court to conduct an evidentiary hearing on Pagan’s allegations of ineffective assistance in connection with the agreement to resolve his rule 3.170(() motion. We caution that Pagan may subject himself to a worse result if he goes forward with this process, but that is his decision to make.
Affirmed in part, reversed in part, and remanded.
CASANUEVA and KHOUZAM, JJ„ Concur.. Brady v. Maryland, 373 U.S. 83, 83 S.Ct. 1194, 10 L.Ed.2d 215 (1963).