
    The People of the State of New York, Respondent, v Waldo Grant, Appellant.
   — Appeal from a judgment of the County Court of Clinton County (Goldman, J.), entered October 30,1981, convicting defendant upon his plea of guilty of the crime of assault in the second degree. Defendant, an inmate at the Clinton Correctional Facility, was involved in a fight with another inmate. When a guard intervened, defendant struck the guard repeatedly with a pipe wrench, inflicting serious physical injuries. Defendant pleaded guilty to assault, second degree, pursuant to a plea bargain, in full satisfaction of the indictment, which included two counts of assault, second degree, and was sentenced as a second felony offender to one and one-half to three years to run consecutively to his prior sentence. On appeal, defendant contends that the proof before the Grand Jury was insufficient to support either count of the indictment in that there was no proof that the guard was performing his lawful duty or that he sustained substantial pain. He further contends that he was denied the right to effective assistance of counsel. Neither contention has merit. Defendant’s challenge to the sufficiency of the Grand Jury evidence was waived upon his plea of guilty and not preserved for appellate review (People v Ali, 79 AD2d 974; People v Thomas, 74 AD2d 317, 321, affd 53 NY2d 338). His assertion of ineffective assistance of counsel is not supported in the record. Examination of the plea minutes demonstrates that defendant’s plea was knowing and voluntary and not simply “his attorney’s idea”. Moreover, defendant expressly confirmed his satisfaction with counsel’s representation. We do find, however, that the sentence imposed was unauthorized as a matter of law. Where, as here, the court has adjudicated a defendant a second felony offender convicted of a class D felony, an indeterminate sentence of imprisonment with a maximum term of at least four years is mandated (Penal Law, § 70.06, subd 2; subd 3, par [d]). In effect, the court was powerless to impose the one- and one-half to three-year term of imprisonment, as promised. Generally, when a guilty plea is induced by an unfulfilled promise made by a court, either the promise must be honored or the plea must be vacated (see People v De Crescente, 64 AD2d 746). Although the error was neither raised below nor in either brief, this court is required, sua sponte, to correct a sentence which is invalid as a matter of law (see GPL 470.15, subd 2, par [c]; People v Bowers, 92 AD2d 669). Under these circumstances, defendant is entitled to an opportunity to withdraw his plea of guilty and stand trial should he so choose (People v Selikoff, 35 NY2d 227, 238-239, cert den 419 US 1122; People v Holmes, 64 AD2d 657; People v Twiggs, '58 AD2d 726). At the very least, resentencing in compliance with the statute is required. Judgment reversed, on the law, and matter remitted to the County Court of Clinton County for further proceedings not inconsistent herewith. Mahoney, P. J., Sweeney, Casey, Weiss and Levine, JJ., concur.  