
616 So.2d 155 (1993)
Johnny FREEMAN, Jr., Appellant,
v.
STATE of Florida, Appellee.
No. 92-684.
District Court of Appeal of Florida, First District.
March 30, 1993.
Johnny Freeman, Jr., pro se.
Robert A. Butterworth, Atty. Gen., and Charlie McCoy, Asst. Atty. Gen., Tallahassee, for appellee.
PER CURIAM.
Johnny Freeman, Jr. has appealed an order of the trial court denying his motion to correct illegal sentence, pursuant to Rule 3.800(a), Florida Rules of Criminal Procedure. We affirm, although not for the reason stated by the trial court.
In January 1991, Freeman pled nolo contendere to robbery, and the trial court sentenced him to 8 years as an habitual offender. Our record does not reflect the exact date of Freeman's offense, nor the offenses relied on by the state in support of habitualization. In February 1992, Freeman filed the instant motion to correct illegal sentence, alleging that section 775.084, Florida Statutes, as amended by Ch. 89-280, Laws of Florida, was unconstitutional as violative of the single-subject rule. See Johnson v. State, 589 So.2d 1370 (Fla. 1st DCA 1991), approved State v. Johnson, 616 So.2d 1 (Fla. 1993).
In support of his motion, Freeman alleged generally that he committed his offenses between October 1, 1989 and May 2, 1991, and that he must therefore be resentenced using the guidelines. He did not allege that he could not have been sentenced as an habitual offender in the absence of the amendments effected by Chapter 89-280. The trial court denied the motion, on the ground that the constitutionality of the habitual offender statute was improperly raised in a motion pursuant to Rule 3.800(a).
*156 Freeman has filed a pro se brief reiterating his argument, to which the state responds that the motion was correctly denied in that Freeman failed to allege that he could not have been classified as an habitual offender without the unconstitutional amendments. See Tims v. State, 592 So.2d 741 (Fla. 1st DCA 1992) (if defendant would qualify as an habitual offender under the 1988 version of the statute, he may not challenge the constitutionality of Chapter 89-280). The state also argues that the trial court was correct on the merits, citing Judge v. State, 596 So.2d 73 (Fla. 2d DCA 1991) (en banc) (Rule 3.800(a) is reserved for the narrow category of cases in which the terms and conditions of the punishment for a particular offense are not permissible as a matter of law).
Rule 3.800(a) allows a defendant to raise the legality of his sentence "at any time." Although Freeman pled to the habitual offender sentence herein, a defendant cannot agree to an illegal sentence as part of a plea bargain. Cribbs v. State, 599 So.2d 246, 247 (Fla. 1st DCA 1992). The question then becomes whether a sentence imposed under an unconstitutional sentencing statute constitutes an "illegal sentence" cognizable under Rule 3.800(a).
The court in Judge addressed a defendant's claim, in a Rule 3.800(a) motion, that he had not received personal notice of the state's intent to seek habitualization. The court rejected this as a proper ground under the rule, in that it did not affect the "terms and conditions of a sentence," and held that an habitual offender sentence was illegal "only if the defendant was improperly subjected to sentencing as an habitual offender and was entitled to sentencing under the guidelines." Judge at 77-78 (emphasis supplied). Put another way, an habitual offender sentence was illegal only if it was "not a sentence that the trial court could, as a matter of law, have imposed." Judge at 78 (emphasis supplied).
In our view, Freeman alleges in the instant motion that, because the habitual offender statute in effect when he committed his offense was unconstitutional, he could not as a matter of law be sentenced as an habitual offender. Therefore, even under the strictures of Judge, Freeman has alleged an illegal sentence properly raised in a motion pursuant to Rule 3.800(a). However, an habitual offender sentence will be reversed on the ground alleged by Freeman only if the defendant was "affected by the amendments to section 775.084 contained in Chapter 89-280." State v. Johnson, 616 So.2d 1, 4 (Fla. 1993) (emphasis in original). Freeman fails to allege that he could not have been habitualized without the amendments effected by Ch. 89-280. Therefore, his motion was properly denied.
Affirmed.
JOANOS, C.J., ERVIN and WIGGINTON, JJ., concur.
