Appeal by the defendant from a judgment of the Supreme Court, Westchester County (Rosato, J.), rendered May 6, 1991, convicting him of attempted criminal possession of a controlled substance in the first degree, upon his plea of guilty, and imposing sentence.
Ordered that the judgment is modified, as a matter of *822discretion in the interest of justice, by reducing the defendant’s conviction to attempted criminal possession of a controlled substance in the second degree; as so modified, the judgment is affirmed.
Prior to the acceptance of his plea of guilty, the defendant withdrew all of his pretrial motions, decided and undecided alike. Thus, he may not raise on appeal the issues proffered in those motions (see, People v Williams, 36 NY2d 829, cert denied 423 US 873; People v Colarusso, 103 AD2d 848).
As part of the negotiated plea bargain, it was agreed that the defendant would plead guilty to a class A-II felony and receive a sentence of an indeterminate term of eight years to life imprisonment. The defendant, however, pleaded guilty to the crime of attempted criminal possession of a controlled substance in the first degree, which is a class A-I felony (see, Penal Law §§ 220.21, 110.05 [1]). A sentence of eight years to life imprisonment constitutes an illegally low term of imprisonment for an A-I felony (see, Penal Law § 70.00 [3] [a] [i]). At the plea proceeding, the parties were under the mistaken impression that the crime of attempted criminal possession of a controlled substance in the first degree was a class A-II felony which would permit the imposition of the agreed-upon sentence. On appeal, the defendant contends that his conviction should be reduced to attempted criminal possession of a controlled substance in the second degree, which is a class AII felony, and the People contend that his conviction should be reduced to criminal possession of a controlled substance in the second degree, which is also a class A-II felony.
Under these circumstances, the conviction of attempted criminal possession of a controlled substance in the first degree should be reduced, in the interest of justice, to attempted criminal possession of a controlled substance in the second degree (Penal Law § 220.18), in order to better effectuate the clear purpose and intent of the plea agreement (see, People v Laino, 186 AD2d 226; People v Brown, 147 AD2d 489). Moreover, since the sentence imposed upon the defendant’s plea was the sentence promised, no purpose would be served by remitting the matter for resentencing. Accordingly, we leave the sentence undisturbed (see, People v Laino, supra, at 226-227; People v Brown, supra, at 490; People v Martinez, 116 AD2d 743). Bracken, J. P., O’Brien, Ritter and Copertino, JJ., concur.