
639 So.2d 147 (1994)
Robert JONES, Appellant,
v.
STATE of Florida, Appellee.
No. 93-109.
District Court of Appeal of Florida, Fifth District.
July 1, 1994.
*148 James B. Gibson, Public Defender, and Daniel J. Schafer, Asst. Public Defender, Daytona Beach, for appellant.
Robert A. Butterworth, Atty. Gen., Tallahassee, and Mark S. Dunn, Asst. Atty. Gen., Daytona Beach, for appellee.
W. SHARP, Judge.
Jones appeals from a sentencing order, imposing an habitual offender sentence, after he pled guilty to one count of possession of cocaine.[1] Jones was sentenced to 4 1/2 years incarceration, followed by 5 years probation. He argues the trial judge erred in imposing this sentence because the state did not file a written notice of intent to seek habitual offender treatment[2] until after the plea had been entered. We agree and reverse.
Jones signed a written plea agreement on October 30, 1992. The agreement recited that Jones could receive a maximum sentence of 5 years, or 10 years if the judge determined him to be an habitual offender. The state filed its notice of intent to seek habitual offender treatment on December 2, 1992. At the sentencing hearing on December 17, 1992, the judge inquired whether Jones had read the plea agreement and conferred with his attorney prior to signing it. Jones responded in the affirmative. The judge then sentenced Jones, imposing habitual offender treatment.
In Ashley v. State, 614 So.2d 486, 489-490 (Fla. 1993), the supreme court discussed section 775.084, Florida Rule of Criminal Procedure 3.172,[3] and Williams v. State, 316 So.2d 267 (Fla. 1975). The facts of Ashley are virtually indistinguishable from those presented here except that in Ashley, the defendant had unsuccessfully sought to withdraw his plea in the trial court. On appeal, he merely appealed his sentence as illegal. The court emphasized that a plea involving habitual offender treatment must be knowing and voluntary because such sentences are imposed in a significant number of cases, and they exceed both the guidelines and the standard statutory maximum sentences.
In Ashley, the court held that an habitual felony offender sentence imposed under these facts was illegal:
[C]onsistent with [that] analysis under rule 3.172, the relevant portion of the habitual offender statute states unequivocally that before a defendant may enter a plea or be sentenced he or she must be given written notice of intent to habitualize. (emphasis added).
Ashley, 614 So.2d at 490. In sum, Ashley appears to require a pre-plea notice of intent to habitualize for an habitual offender sentence to stand as legally valid, even though as a practical matter, this is not the way criminal cases are currently handled at the trial level.
The state notes that the plea agreement raised the possibility of an habitual offender sentence, and that the judge conducted an inquiry of Jones, prior to sentencing him, as to whether the plea was knowing and voluntary. It argues the foregoing was sufficient to meet the dictates of Ashley. However, we considered this issue en banc and ruled against the state's position. See Thompson v. State, 638 So.2d 116 (Fla. 5th DCA 1994).
Accordingly, we reverse the sentence and remand this case to the trial court. At resentencing, the court should either sentence within the guidelines or, if it believes a more severe punishment is justified, it should so advise appellant and allow him the option of *149 withdrawing his plea or accepting the greater sentence.
REVERSED AND REMANDED.
PETERSON and DIAMANTIS, JJ., concur.
NOTES
[1]  Section 893.13(1)(f), Florida Statutes (1991), a third degree felony.
[2]  As authorized by section 775.084(3)(b), Florida Statutes (1991), which provides:

Written notice shall be served on the defendant and his attorney a sufficient time prior to the entry of a plea or prior to the imposition of sentence so as to allow the preparation of a submission on behalf of the defendant.
[3]  Rule 3.172(a) provides:

Before accepting a plea of guilty or nolo contendere, the trial judge shall be satisfied that the plea is voluntarily entered and that there is a factual basis for it.
