Appeal from a resentence of the Supreme Court, Onondaga County (John J. Brunetti, A.J.), rendered July 5, 2012. Defendant was resentenced upon his conviction of robbery in the first degree, burglary in the first degree, robbery in the second degree and burglary in the second degree.
It is hereby ordered that the resentence so appealed from is unanimously reversed on the law and the matter is remitted to Supreme Court, Onondaga County, for further proceedings in accordance with the following memorandum: In 2000, defendant was convicted in Supreme Court and County Court, upon his pleas of guilty, of various violent felonies charged in four separate indictments and a superior court information, and the respective courts imposed determinate sentences without post-release supervision. At subsequent resentencing proceedings, Supreme Court reimposed the original sentences, again without postrelease supervision, upon the consent of the People (see Penal Law § 70.85; People v Bennefield [appeal No. 2], 109 AD3d 1152, 1153-1154 [2013], lv denied 22 NY3d 1087 [2014]), and defendant appeals from each resentence. He was resentenced in appeal Nos. 1 through 3 and appeal No. 5 to concurrent determinate terms of imprisonment, the longest of which are terms of 20 years. He was resentenced in appeal No. 4 to a determinate term of imprisonment of five years for burglary in the first degree (Penal Law § 140.30 [4]), to run consecutively to the other resentences.
Defendant contends in each appeal that the resentences must *1660be vacated because he was improperly sentenced as a first violent felony offender rather than a second violent felony offender (see generally People v Halsey, 108 AD3d 1123, 1124-1125 [2013]; People v Stubbs, 96 AD3d 1448, 1450 [2012], lv denied 19 NY3d 1001 [2012]). We agree. It was apparent throughout the pendency of these matters that defendant had a prior violent felony conviction, and therefore, at resentencing, “the People were required to file a second [violent] felony offender statement in accordance with CPL [400.15] and, if appropriate, the court was then required to sentence defendant as a second [violent] felony offender” (People v Griffin, 72 AD3d 1496, 1497 [2010]). Inasmuch as “ ‘[i]t is illegal to sentence a known predicate felon as a first offender’ ” (id.), we reverse the resentence in each appeal and remit the matters to Supreme Court for resentencing in compliance with CPL 400.15 (see generally Halsey, 108 AD3d at 1124-1125; Griffin, 72 AD3d at 1497).
Although defendant is correct that the five-year term of imprisonment imposed in appeal No. 4 for burglary in the first degree is illegal for a second violent felony offender (see Penal Law § 70.04 [3] [a]), that circumstance does not entitle him to an opportunity to withdraw his plea with respect to each appeal at this juncture (cf. generally People v Ciccarelli, 32 AD3d 1175, 1176 [2006]). Rather, if the court upon remittal determines that defendant must be sentenced as a second violent felony offender, it must either impose a legal sentence in a manner that ensures that he receives the benefit of his plea agreement or allow the parties the opportunity to withdraw from that agreement (see generally People v Collier, 22 NY3d 429, 432-434 [2013]).
In view of our determination, we do not address defendant’s remaining contention.
Present—Whalen, P.J., Peradotto, Carni, Lindley and DeJoseph, JJ.