
818 So.2d 253 (2002)
STATE of Louisiana
v.
Aaron HOUSTON.
No. 2002-KA-0255.
Court of Appeal of Louisiana, Fourth Circuit.
April 24, 2002.
Harry F. Connick, District Attorney, Leslie Parker Tullier, Assistant District Attorney, New Orleans, LA, for Plaintiff/Appellant.
Karen G. Arena, Louisiana Appellate Project, River Ridge, LA, for Defendant/Appellant.
(Court composed of Chief Judge WILLIAM H. BYRNES III, Judge MIRIAM G. WALTZER, Judge MICHAEL E. KIRBY).
KIRBY, Judge.
The defendant, Aaron Houston, was charged by bill of information on October 16, 2000, with possession of cocaine in violation of La. R.S. 40:967(C). He was arraigned *254 on October 19, 2000 and pleaded not guilty. After a hearing on November 3, 2000, the trial court found probable cause to bind the defendant over for trial and denied the motion to suppress the confession. After a trial on November 29, 2000, a six-member jury found the defendant guilty of the lesser-included offense of attempted possession of cocaine. The State filed a multiple bill charging the defendant as a fourth felony offender, and on August 29, 2001, after a hearing at which the State proved the charges, defendant was sentenced to serve thirty years at hard labor.
At trial, Officers Cedric Gray and Mike Montalbano testified that they were on pro-active patrol about 6:35 p.m. on September 19, 2000, in the 1200 block of South Robertson Street when they noticed the defendant. He was walking in the same direction the officers were driving, and after he glanced over his shoulder and saw them, he seemed to become nervous. He stopped, put his right hand in his right pants pocket, removed a bag, dropped it to the sidewalk, and began to walk fast. Although the officers were wearing plain clothes, they were driving a 1997 Crown Victoria with a blue light on the dash; Officer Gray opined that the car is easily recognized as a police car. The officers stopped and detained the defendant who said, "I didn't drop that bag." Officer Montalbano patted him down for weapons, and Officer Gray retrieved the bag that contained a glass tube.
Officer Harry O'Neal, an expert in analysis of controlled, dangerous substances, testified that he examined the tube taken as evidence in this case. Officer O'Neal performed two conclusive testing procedures on the residue in the tube and both tests indicated the substance was crack cocaine.
Aaron Houston, the thirty-nine year old defendant, took the stand and admitted he had prior convictions for possession of marijuana, distribution of false drugs, distribution of cocaine, possession of a crack pipe, simple burglary of a business and simple gang robbery. When asked to describe what happened the day he was arrested, Houston said that he had been released from jail for trespassing and being drunk in public that morning, but he went to work that day. Late that afternoon, he was walking to his second job when the police stopped him. As the officers who testified at trial were searching him, another police officer drove up. That man asked if he had any rocks, and Houston answered, "I ain't have no rocks, man. I ain't throwed [sic] nothing." He said the officers discussed giving Houston a plain rock or arresting him for trespassing; however, the third officer, who was never named, showed the other two a crack pipe and said, "We got him now." Houston was carrying a brown bag containing leftover lunch, and the officers took a sandwich bag from the brown bag and put the crack pipe in it. Houston told the officers what they were doing was wrong, and they told him he was "wrong for being in a drug area." Under cross-examination, Houston admitted to being an ex-crack addict.
Both the defendant and the State appeal the thirty-year sentence.[1] The defendant maintains that the sentence is unconstitutionally excessive in that his crime was possession of a residue of cocaine and the trial court focused only on his criminal history in imposing the sentence. The State contends that the court erred in not *255 sentencing the defendant to the mandatory term of life imprisonment under La. R.S. 15:529.1A(1)(c)(ii). At the time of Houston's offense, that statute provided:
If the fourth or subsequent felony or any of the prior felonies is a felony defined as a crime of violence under R.S. 14:2(13) or as a violation of the Uniform Controlled Dangerous Substances Law punishable by imprisonment for more than five years or of any other crime punishable by imprisonment for more than twelve years, the person shall be imprisoned for the remainder of his natural life, without benefit of parole, probation, or suspension of sentence.
The defendant was adjudicated a fourth felony offender. One of his prior felonies was distribution of cocaine, which is a violation of the Controlled Dangerous Substances Law punishable by more than five years. Thus, the statute prescribes a sentence of life imprisonment without benefit of probation, parole or suspension of sentence.
The State's position is correct. The trial court filed a per curiam in this court stating that the sentence was based upon the retroactive application of the 2001 amendments to La. R.S. 15:529.1A (1)(c)(i) and (ii) which did not become effective until June 15, 2001.[2] The offense at issue here occurred on September 19, 2000.
Recently, this Court considered three cases in which defendants convicted of violations of La. R.S. 40:966(C) received suspended sentences and probation even though their offenses occurred prior to June 15, 2001, the effective date of the amendment.[3]State v. Carter, XXXX-XXXX (La App. 4 Cir. 10/3/01), 798 So.2d 1181; State v. Legendre, XXXX-XXXX (La.App. 4 Cir. 10/3/01), 798 So.2d 1179; State v. Serpas, XXXX-XXXX (La.App. 4 Cir. 10/3/01), 798 So.2d 1178. In each case, the State objected and filed a writ application contending that the sentence was illegal. This Court agreed, stating:
It is well settled that the penalty set out in a statute at the time of offense applies. State v. Ragas, 98-0011 (La. App. 4 Cir. 7/28/99), 744 So.2d 99. The fact that a statute is subsequently amended to lessen the possible penalty does not extinguish liability for the offense committed under the former statute. State v. Narcisse, 426 So.2d 118 (La.1983).
State v. Carter, 798 So.2d at 1182; State v. Legendre, 798 So.2d at 1180; State v. Serpas, 798 So.2d at 1179. In those cases, the sentences were vacated.
*256 Acts 2001, No. 403, § 2, effective June 15, 2001, amended La. R.S. 15:529.1(A)(1)(b)(ii) and (c)(ii). Section 6 of that Act 403 provides "[t]he provisions of this Act shall only have prospective effect." In this case, the trial court erroneously sentenced defendant under the 2001 amendment to R.S. 15:529.1, which was not in effect at the time of the defendant's offense. The defendant's sentence must be vacated and the case remanded for resentencing.[4] Because of the need for a remand, the defendant's assignment of error is moot.
Accordingly, for reasons cited above, the defendant's conviction is affirmed, his thirty-year sentence is vacated, and the case is remanded for resentencing.
CONVICTION AFFIRMED; SENTENCE VACATED; REMANDED.
NOTES
[1]  Although there is no motion to reconsider the sentence in the record, this defendant's sentence is illegal and, under La.C.Cr.P. art. 882, an appellate court may correct an illegal sentence on review.
[2]  The amended version of La R.S. 15:529.1(A)(1)(c) provides:

If the fourth or subsequent felony is such that, upon a first conviction the offender would be punishable by imprisonment for any term less than his natural life then:
(i) The person shall be sentenced to imprisonment for the fourth or subsequent felony for a determinate term not less than the longest prescribed for a first conviction but in no event less than twenty years and not more than his natural life; or
(ii) If the fourth felony and two of the prior felonies are felonies defined as a crime of violence under R.S. 14:2(13), a sex offense as defined in R.S. 15:540 et seq. when the victim is under the age of eighteen at the time of commission of the offense, or as a violation of the Uniform Controlled Dangerous Substances Law punishable by imprisonment for ten years or more or any combination of such crimes, the person shall be imprisoned for the remainder of his natural life, without benefit of parole, probation, or suspension of sentence.
[3]  At the time the offenses occurred La. R.S. 40:966(C) restricted the benefits of probation and suspension of sentence. However, prior to the sentencings the legislature amended the statute by deleting the words "without benefit of probation or suspension of sentence." Acts 2001, No. 403.
[4]  We remand because the defendant has never been legally sentenced under a valid statute. Had he originally been sentenced under a valid statute and then re-sentenced under the new statute (applied retroactively improperly) we could merely vacate the new sentence and reinstate the former without the necessity of a remand.
