
547 So.2d 68 (1989)
Ex parte Gilbert W. BRANNON.
(Re Gilbert Brannon
v.
State of Alabama).
87-843.
Supreme Court of Alabama.
February 10, 1989.
Douglas M. Bates, Dothan, for petitioner.
Don Siegelman, Atty. Gen., and Mary Ellen Forehand, Asst. Atty. Gen., for respondent.
MADDOX, Justice.
Gilbert Brannon pleaded guilty to possession of controlled substances. At the sentencing hearing, the prosecutor produced certified copies of three prior felony convictions (none of which was drug-related). Brannon was then sentenced under Ala. Code 1975, § 13A-5-9 (hereinafter the "Habitual Felony Offender Act"). The Court of Criminal Appeals affirmed, without opinion. 524 So.2d 387.[*] We granted certiorari to decide whether the sentencing of Brannon under the Habitual Felony Offender Act conflicts with our decision in Ex parte Chambers, 522 So.2d 313 (Ala.1987). We find that it does, and hold that Brannon was incorrectly sentenced; therefore, we remand the cause for a new sentencing proceeding.
The State contends that we should not reach the issue of the propriety of Brannon's sentence because Brannon did not object to his being sentenced under the Habitual Felony Offender Act. It is true that Brannon did not object, but we hold that an objection was unnecessary in this case. Brannon's sentencing occurred several months before this Court decided Chambers, so Brannon's counsel would not have known of that decision and its effect on sentencing under the Habitual Felony Offender Act; however, when a sentence is clearly illegal or is clearly not authorized by statute, the defendant does not need to object at the trial level in order to preserve that issue for appellate review. See Bartone v. United States, 375 U.S. 52, 84 S.Ct. 21, 11 L.Ed.2d 11 (1963). Indeed, the illegality of a defendant's sentence is a ground specified in Rule 20, Ala.R.Crim.P., for a collateral post-conviction remedy.
*69 In Chambers, the defendant was convicted of a drug-related offense and had a prior drug-related offense; he was sentenced under the Habitual Felony Offender Act. This Court held:
"The Habitual Felony Offender Act, with its punishment enhancement provisions, is a penal statute, and must be strictly construed, especially in regard to its applicability to felony offenses outside the Criminal Code. A careful reading of the pertinent provisions of Title 13A, Chapter 5, along with the commentary thereto, makes it quite obvious that the legislature did not intend the Habitual Felony Offender Act to apply to felony drug offenses."
522 So.2d at 316.
The State contends that the present case is not controlled by Chambers because Chambers's prior offense was drug-related and Brannon's prior offenses were not drug-related. This distinction makes no difference; Chambers makes it clear that "defendants convicted [under the Controlled Substances Act] must be sentenced according to its provisions, not the sentencing provisions of Title 13A." 522 So.2d at 316 (emphasis in original). It is anomalous that a defendant convicted of a drugrelated crime will have his sentence enhanced if he has prior drug-related convictions but will not have his conviction enhanced if he has prior non-drug-related convictions, but the clear wording of the relevant statutes will not permit any other result. We note that the Controlled Substances Act has been amended by Acts of Alabama 1987, No. 87-603, the "Drug Crimes Amendments Act of 1987." This act repealed § 20-2-70, the recidivist provision within the Controlled Substances Act, for conduct occurring after the effective date of the act, and it made drug-related crimes subject to the Habitual Felony Offender Act. The effective date of this act was October 21, 1987. Since Brannon's conduct that led to this conviction occurred prior to October 21, 1987, Act No. 87-603 is not applicable to him, and his sentencing is controlled by Chambers.
Based on the foregoing, this cause is remanded to the Court of Criminal Appeals with directions to remand the cause to the trial court for proceedings consistent with this opinion.
REMANDED WITH DIRECTIONS.
HORNSBY, C.J., and JONES, ALMON, SHORES, ADAMS, HOUSTON, STEAGALL and KENNEDY, JJ., concur.
NOTES
[*]  Reporter's note: The rehearing denial was incorrectly reported at 531 So.2d 63, with the docket number 4 Div. 854; the correct docket number in the Court of Criminal Appeals was 4 Div. 853.
