
    The People of the State of New York, Respondent, v Steven M. Kilgore, Appellant.
    (Appeal No. 1.)
    [608 NYS2d 12]
   Judgment unanimously modified on the law and as modified affirmed and matter remitted to Onondaga County Court for further proceedings in accordance with the following Memorandum: We reject the People’s contention that defendant waived his right to appeal his sentencing as a predicate felon without a hearing when he accepted the plea agreement. The right to challenge the legality of a sentence is not subject to waiver (see, People v Callahan, 80 NY2d 273, 281; People v Francabandera, 33 NY2d 429).

County Court erred in summarily refusing to consider the constitutional challenge of defendant to his prior felony conviction. When the constitutionality of a predicate felony is attacked, the sentencing court must conduct a hearing prior to imposing a second felony offender sentence (CPL 400.21 [5]; People v Longboat, 154 AD2d 916). We, therefore, modify the judgments by vacating defendant’s sentences and remit the matters to the sentencing court for a hearing to determine the merits of the challenge to defendant’s predicate felony conviction (see, CPL 400.21 [7] [b]). (Appeal from Judgment of Onondaga County Court, Cunningham, J.—Criminal Sale Controlled Substance, 3rd Degree.) Present—Denman, P. J., Callahan, Pine, Doerr and Boehm, JJ.  