Appeal by the People, as limited by their brief, from a sentence of the County Court, Rockland County (Resnik, J.), rendered May 17, 2005, imposed upon the conviction of the defendant of criminal possession of a controlled substance in the third degree, upon his plea of guilty, the sentence being a determinate term of imprisonment of three and one-half years.
Ordered that the sentence is reversed, on the law, and the matter is remitted to the County Court, Rockland County, for further proceedings in accordance herewith.
The bargained-for determinate sentence of three and one-half years’ imprisonment imposed upon the defendant’s conviction of criminal possession of a controlled substance in the third degree, as a second felony offender, was illegal (see Penal Law § 70.06 [3] [b]; [4] [b]). The defendant committed the crime before the enactment of the Drug Law Reform Act (L 2004, ch 738; hereinafter the DLRA). Thus, he was not entitled to be sentenced under the DLRA (see People v Torres, 26 AD3d 398 [2006]; People v Goode, 25 AD3d 723 [2006]). In section 41 (d-1) *763of the DLRA, the Legislature expressed its intent that, with certain exceptions not applicable herein, the ameliorative provisions of the act were not to be applied to crimes committed before the effective date of the act. Since the defendant pleaded guilty with the understanding that he would receive a sentence which was illegal, the matter is remitted to the County Court, Rockland County, to give the defendant the option either to withdraw his plea or receive a legal sentence (see People v Dabbs, 280 AD2d 611 [2001]; People v Ruiz, 226 AD2d 747 [1996]). Schmidt, J.P., Crane, Krausman, Skelos and Lunn, JJ., concur.