
739 So.2d 1235 (1999)
Clifford SHELTON, Appellant,
v.
STATE of Florida, Appellee.
No. 98-3474.
District Court of Appeal of Florida, Fourth District.
August 11, 1999.
Clifford Shelton, Indiantown, pro se.
Robert A. Butterworth, Attorney General, Tallahassee, and Gentry Denise Benjamin, Assistant Attorney General, West Palm Beach, for appellee.
PER CURIAM.
Clifford Shelton appeals from the trial court's denial of his motion to vacate and correct illegal sentence raised pursuant to Florida Rule of Criminal Procedure 3.800. We affirm in part, reverse in part, and remand.
*1236 In 1987, Shelton was charged with attempted sexual battery and aggravated assault. While awaiting trial on those charges, he was separately charged with battery on a law enforcement officer in 1988. In 1989, he was charged with aggravated battery.
He was convicted on the 1987 charges, declared an habitual felony offender and sentenced to thirty years in prison. He was also convicted of the 1988 charges after a bench trial and the 1989 charges after a jury trial, declared an habitual felony offender, and sentenced to ten years and thirty years, respectively, to run consecutive to the other sentences. This court affirmed Shelton's 1988 and 1989 convictions. See Shelton v. State, 576 So.2d 1327 (Fla. 4th DCA 1991); Shelton v. State, 590 So.2d 426 (Fla. 4th DCA 1991).
Shelton appealed his 1987 conviction and this court reversed and remanded for a new trial. See Shelton v. State, 563 So.2d 820 (Fla. 4th DCA 1990). He was retried and again convicted of the 1987 charges, declared an habitual felony offender, and sentenced to thirty years in prison. He appealed his 1987 conviction a second time, and this court affirmed. See Shelton v. State, 603 So.2d 10 (Fla. 4th DCA 1992). Thereafter, Shelton filed a motion for postconviction relief pursuant to Florida Rule of Criminal Procedure 3.850. The trial court granted his motion, vacated his conviction and sentence and set the case for a new trial. On March 24, 1995, he pled guilty to attempted sexual battery with a weapon and aggravated assault; he agreed to be sentenced as an habitual felony offender and waived further hearing. The trial court sentenced him to thirty years on the first count and ten years on the second count, both maximum habitual felony offender sentences for the offenses involved.
He subsequently filed this motion pursuant to Florida Rule of Criminal Procedure 3.800(a) to vacate and correct illegal sentence, which the trial court summarily denied. On appeal, Shelton raises numerous arguments attacking the validity of his sentences, including an ex post facto challenge. Only his arguments concerning the imposition of the habitual felony offender sentences with respect to his 1987 and 1988 convictions merit discussion.
Shelton contends that his 1987 and 1988 sentences were illegal because his habitual offender status was not a valid basis for departure from the sentencing guidelines under the law in effect at the time when his offenses were committed. We agree. See Whitehead v. State, 498 So.2d 863 (Fla.1986); Strickland v. State, 596 So.2d 1155 (Fla. 2d DCA), rev. denied, 602 So.2d 942 (Fla.1992), cert. denied, 507 U.S. 923, 113 S.Ct. 1289, 122 L.Ed.2d 681 (1993). Specifically, he alleges that his September 7, 1987 and July 20, 1988 offenses preceded the October 1, 1988 effective date of section 775.084, Florida Statutes. See Strickland, 596 So.2d at 1156. "Prior to the 1988 amendment, a trial court could not enhance a sentence in excess of the guidelines under the habitual offender statute." Id.; Ch. 88-131, § 6, Laws of Florida.
This issue is appropriate for review pursuant to Florida Rule of Criminal Procedure 3.800(a) and Davis v. State, 661 So.2d 1193 (Fla.1995), which provides that a sentence is illegal if it "exceeds the maximum allowed by law." Id. at 1196. State v. Mancino, 714 So.2d 429 (Fla.1998), further provides, "[a] sentence that patently fails to comport with statutory or constitutional limitations is by definition `illegal.'" Id. at 433. We hold that appellant's sentencing challenges fall within the parameters of Davis and Mancino.
The trial court's sole reason for departing from the sentencing guidelines on Shelton's 1987 conviction was that he qualified as an habitual felony offender. The state does not dispute this, but argues that Shelton agreed to accept a habitual felony offender sentence as part of his plea. While we recognize that a plea agreement may support a departure sentence, *1237 the departure sentence must be within the statutory maximum. See Quarterman v. State, 527 So.2d 1380 (Fla.1988); see also State v. Williams, 667 So.2d 191 (Fla.1996). Shelton's sentence as an habitual offender resulted in a sentence in excess of the statutory maximum, therefore, we reject the state's argument because a defendant cannot be bound to an agreement to accept an illegal sentence. See Cheney v. State, 640 So.2d 103, 105 (Fla. 4th DCA 1994); Dyer v. State, 629 So.2d 285, 286 (Fla. 5th DCA 1993); Stephens v. State, 627 So.2d 543, 544 (Fla. 2d DCA 1993).
The trial court also erred in imposing a habitual felony offender sentence in excess of the statutory maximum for Shelton's 1988 conviction. At the time of his 1988 offense, "... the guidelines statute had been construed to preclude the application of the habitual offender statute as an alternative to guidelines sentencing or as a reason for departure." Strickland, 596 So.2d at 1155. Because Shelton's sentence as an habitual offender resulted in a sentence in excess of the statutory maximum, we vacate the sentence and remand the cause for resentencing.
Since this matter must be remanded for resentencing, we will briefly discuss the trial court's additional reason for its departure sentence with respect to the 1988 conviction. The court found that, "[t]his guy is dangerous. There has been a continuing pattern of sexual attacks." Although departure is permissible when "the defendant has shown a pattern of engaging in increasingly serious criminal activity," Barfield v. State, 594 So.2d 259, 261 (Fla.1992) (citing Williams v. State, 581 So.2d 144, 146 (Fla.1991)), the supreme court disapproved a departure sentence based solely on a persistent pattern of criminal activity where the pattern was not escalating towards more violent or serious crimes. See Smith v. State, 579 So.2d 75, 76 (Fla.1991). The trial court's finding of only a continuing pattern of sexual attacks is insufficient to support a departure sentence.
Accordingly, we reverse the trial court's order denying Shelton's motion to vacate and correct illegal sentence. On the 1987 charges we remand for either resentencing or to permit the state to seek to vacate the judgment and sentence, and proceed to trial. See Freshman v. State, 730 So.2d 351, 352 (Fla. 4th DCA 1999); Hawes v. State, 712 So.2d 834, 835 (Fla. 4th DCA 1998). On the 1988 conviction we remand for resentencing. We affirm appellant's sentence on his 1989 conviction.
AFFIRMED, in part; REVERSED, in part, and REMANDED.
DELL, FARMER and HAZOURI, JJ., concur.
