Judgment unanimously affirmed. Memorandum: In February 1987, defendant was sentenced to 168 days in jail (time served) and five years’ probation on his plea to second degree criminal possession of stolen property. At the time of the plea and sentencing, neither the prosecution nor the court was aware that defendant had a prior felony conviction. In fact, the People’s plea offer, and the court’s consent to it, was in part the product of defense counsel’s express representations, during the bail and plea proceedings, that defendant had only a *993minor criminal record and no prior felony conviction. Subsequently, the People learned that defendant had a 1983 conviction for attempted second degree burglary under a previously undisclosed alias. In December 1987, the People moved to set aside the sentence on the ground that it was invalid as a matter of law and obtained by fraud. They requested that defendant be resentenced as a second felony offender. The court granted the People’s application to set aside the sentence. Thereafter, despite being granted the opportunity to withdraw his guilty plea, defendant reaffirmed his guilty plea, admitted the allegations in the second felony offender statement, and, as stipulated in a second set of plea negotiations, received a sentence of IVi to 3 years.
We reject the People’s contention that defendant waived any challenge to the validity of his resentencing by reaffirming his guilty plea in consideration of the court’s express sentencing commitment (see, People v Thompson, 60 NY2d 513, 520). Defendant’s challenge to his resentencing states a claim that his sentence is invalid as a matter of law (see, CPL 450.30 [1]), which claim cannot be waived (People v Seaberg, 74 NY2d 1, 9; People v Morse, 62 NY2d 205, 214, n 2; People v Fuller, 57 NY2d 152, 156).
Addressing the merits, we conclude that the court was authorized, and indeed was obligated, to resentence defendant on the People’s timely and proper motion (see, CPL 440.40 [1]; 440.60). The sentence initially imposed upon defendant, a second felony offender, was invalid as a matter of law (see, Penal Law § 70.06 [2]; CPL 400.21; People v Scarbrough, 66 NY2d 673, revg on dissent below 105 AD2d 1107; People v Kuyal, 155 AD2d 901, 902, lv denied 75 NY2d 920, 76 NY2d 738; People v Gilchrist, 152 AD2d 923). Scarbrough (supra) holds that it is illegal to sentence a known predicate felon as a first offender and that such sentence must be corrected on the People’s motion. Defendant urges that this case is distinguishable from Scarbrough because here the authorities did not know, at the time of sentencing, that defendant was a second felony offender. To distinguish Scarbrough on that basis would be illogical, particularly where, as here, defendant contributed to the lack of awareness by using an alias and by misrepresenting, through his attorney, that he had no prior felony conviction (see, People v Lewis, 138 Misc 2d 822; People v Sapp, 105 Misc 2d 312; cf., People v Bouchard, 149 AD2d 980, lv denied 74 NY2d 661; but see, People v Saez, 125 Misc 2d 125). (Appeal from judgment of Genesee County Court, Morton, J.— *994criminal possession of stolen property, second degree.) Present —Denman, J. P., Boomer, Pine, Davis and Lowery, JJ.