
14 So.3d 257 (2009)
Richard BOZZUTO, Appellant,
v.
STATE of Florida, Appellee.
No. 5D09-555.
District Court of Appeal of Florida, Fifth District.
July 24, 2009.
Richard A. Bozzuto, Lake City, pro se.
Bill McCollum, Attorney General, Tallahassee, and Anthony J. Golden, Assistant Attorney General, Daytona Beach, for Appellee.
COHEN, J.
Appellant, Richard Bozzuto, challenges the trial court's denial of his postconviction motion filed pursuant to Florida Rule of Criminal Procedure 3.800(a). We reverse and remand.
Bozzuto pled guilty to attempted sexual battery on a child under the age of twelve in violation of section 794.011(2), Florida Statutes. At sentencing, Bozzuto appeared for two separate cases: attempted sexual battery and corruption by threat. Bozzuto was sentenced to twenty years' incarceration followed by fifteen years' sex offender probation, for a total sentence of thirty-five years for the attempted sexual battery. He received a concurrent five-year sentence for his corruption by threat conviction. Bozzuto subsequently filed the instant rule 3.800(a) motion, asserting that his sentence for attempted sexual battery *258 was illegal because it exceeded the maximum penalty under section 777.04(4)(b), Florida Statutes (2006), of thirty years. According to Bozzuto, his thirty-five year sentence could only have been legal if he was given the maximum sentence for attempted sexual battery, thirty years, plus five years on the corruption by threat charge, with the sentences to run consecutively.
The trial court denied the motion, ruling that, under Florida Rule of Criminal Procedure 3.704, the statutory maximum could be exceeded when the Criminal Punishment Code scoresheet provided for a greater sentence. However, this is only the case when the lowest permissible sentence under the Criminal Punishment Code exceeds the statutory maximum. Fla. R.Crim. P. 3.704(d)(5); Leduc v. State, 803 So.2d 898, 899 (Fla. 5th DCA 2002); Cillo v. State, 913 So.2d 1233, 1234 (Fla. 2d DCA 2005).
In this case, the lowest permissible sentence under the Criminal Punishment Code scoresheet was 97.8 months' (or 8.15 years) incarceration. The maximum sentence that could be imposed was thirty years. Because the lowest permissible sentence under the Criminal Punishment Code did not exceed the statutory maximum, the trial court erred by imposing a sentence that exceeded the maximum provided by section 777.04(4)(b). Id. We therefore reverse the order denying relief and remand for resentencing, or to allow the State to withdraw from the plea agreement. See Thomas v. State, 932 So.2d 1221 (Fla. 5th DCA 2006).
REVERSED and REMANDED for further proceedings.
ORFINGER and TORPY, JJ., concur.
