Appeal *908from the judgment of the County Court of Sullivan County (Kane, J.), rendered September 18, 1992, convicting defendant upon his plea of guilty of two counts of the crime of attempted murder in the second degree.
Pursuant to a plea bargain, defendant, a second felony offender, agreed to plead guilty to two counts of attempted murder in the second degree and waived his right to appeal in exchange for concurrent prison sentences of 12 to 25 years on each count. County Court sentenced him in accordance with the plea bargain on September 16, 1992. However, because it believed it had not complied with CPL 400.21, on September 18, 1992 County Court vacated the sentence it imposed on September 16, 1992, arraigned defendant on the second felony statement and resentenced him to the same term of imprisonment as before. Defendant then initiated this appeal in which he primarily challenges the legality of his sentence.
Initially, we note that this appeal is not precluded by defendant’s waiver of his right to appeal because a defendant cannot waive the right to challenge the legality of a sentence (see, People v Seaberg, 74 NY2d 1, 9).
Inasmuch as defendant did not object, we perceive no error in County Court’s vacatur of the sentence it imposed on September 16, 1992 (see, People v Calderon, 79 NY2d 61, 65; Matter of Kisloff v Covington, 73 NY2d 445, 452). Therefore, we find the September 18, 1992 sentence to have been legally imposed. We note that County Court did not have to follow the procedure it did because defendant was properly sentenced as a second felony offender on September 16, 1992. The record discloses that County Court advised defendant in the presence of his counsel that his prior conviction of driving while intoxicated as a felony provided a sufficient basis for adjudging him a second felony offender. Defendant indicated that he understood and asked the court to proceed with the sentencing (see, People v Bouyea, 64 NY2d 1140; People v Haimson, 164 AD2d 867; People v Raney, 131 AD2d 901, lv denied 70 NY2d 754).
Lastly, we reject defendant’s claim of ineffective assistance of counsel because there is no suggestion that the acceptance of the plea was infected by any ineffective assistance of counsel (see, People v Petgen, 55 NY2d 529, 534-535). For the reasons stated, we affirm the judgment of conviction.
Mikoll, J. P., Mercure, Crew III and Yesawich Jr., JJ., concur. Ordered that the judgment is affirmed.