
    Armando GARCIA, Appellant, v. The STATE of Florida, Appellee.
    No. 97-3450.
    District Court of Appeal of Florida, Third District.
    Nov. 4, 1998.
    
      Armando Garcia, in proper person.
    Robert A. Butterworth, Attorney General, and Terri Leon-Benner, Assistant Attorney General, for appellee.
    Before NESBITT, JORGENSON and COPE, JJ.
   PER CURIAM.

On appeal of the denial of his motion to correct an illegal sentence, Armando Garcia alleges that his January 1994 sentence, upon revocation of probation, as a habitual felony offender was improper. Upon the State’s confession of error and our independent review, we agree. We hereby vacate Garcia’s sentence on consolidated cases 91-7770, 92-11199, 92-16979 and 92-16980, and remand for resentencing. We affirm Garcia’s sentence on case 93-36193.

In February 1993, the four underlying cases relevant to this motion were consolidated for purposes of a plea agreement. Garcia pled guilty and was sentenced to a total of twenty-seven years. The trial court mitigated the sentence to community control for two years followed by five years probation. This mitigated sentence was specified in the plea agreement. Significantly, the State did not seek to apply the habitual felony offender statute to Garcia, nor did the trial court determine that Garcia was a habitual felony offender.

In November 1993, Garcia was charged in case 93-36193 with battery on a law enforcement officer, resisting an officer with violence, openly carrying a weapon and unlawftd possession of a firearm by a convicted felon. Garcia pled guilty and was sentenced on these charges as a habitual felony offender. Garcia does not challenge this determination as to these charges. The new offenses were also the basis of the State’s affidavit for violation of probation on the earlier cases. Upon revocation of probation, the trial court sentenced Garcia as a habitual felony offender to twenty years in prison. Garcia challenges this sentence.

Per Ashley v. State, 614 So.2d 486 (Fla.1993), the State is required to serve written notice of its intent to habitualize pri- or to a defendant’s plea. If a defendant pleads guilty or nolo contendere without such notice, the State cannot then seek enhancement of the sentence under the habitual felony offender or habitual violent offender statute, section 775.084(1), Florida Statutes (1995). This is because before a court can accept a guilty plea, it must ensure that the defendant knows the maximum punishment available — obviously, this would include knowledge of the HFO or HVO sentence enhancement.

Prior to his February 1993 plea agreement, Garcia was not given notice that the .HFO statute would be applied. Upon revocation of probation in January 1994, therefore, the trial court had no authority to enhance Garcia’s sentence by applying the HFO statute after-the-fact. A court cannot, upon revocation of probation, sentence a defendant as an HFO or HVO when the State neither sought the enhanced sentence originally nor filed intent to habitualize the defendant before the defendant’s original plea hearing. See Snead v. State, 616 So.2d 964 (Fla.1993). Thus, the twenty-year sentence Garcia received under the HFO statute was an illegal sentence. The trial court could not have sentenced Garcia to this sentence originally, and to do so upon revocation of probation was improper, as it would — in these circumstances' — impose a sentence beyond the maximum sentence permitted by law.

For the foregoing reasons, we vacate the sentence on cases 91-7770, 92-11199, 92-16979 and 92-16980, and remand for resen-tencing consistent with this opinion and with Garcia’s plea agreement in these cases. We affirm the sentence on case 93-36193.  