Appeal by the People, pursuant to CPL 450.20 (subd 5), and cross appeal by the defendant from an order of the County Court, Dutchess County (Bernhard, J.), dated October 14,1980, which, on defendant’s motion, inter alia, to set aside a sentence of imprisonment imposed March 14, 1980, upon a plea of guilty, effectively denied said motion and, sua sponte, vacated the judgment of conviction and reinstated the defendant’s plea of “not guilty”. Permission for taking the cross appeal is hereby granted by Mr. Justice Gulotta. Order reversed, on the law, defendant’s plea of guilty reinstated and case remanded to the County Court, Dutchess County, for further proceedings in accordance herewith. Upon satisfying itself that it could not legally honor the full extent of the sentencing commitment made to the defendant (see Matter of Kalamis v Smith, 42 NY2d 191; Matter of Gonzalez v Kearney, 62 AD2d 345; see, also, Penal Law, § 70.30, subds 1, 3), the County Court erred in proceeding, sua sponte, to vacate the defendant’s guilty plea without obtaining his consent. Upon the remand, the defendant should be afforded the opportunity of withdrawing his guilty plea or accepting a proper sentence (see People v Matthews, 71 AD2d 864; People v Hardin, 67 AD2d 12; People v Ford, 65 AD2d 822). A promise to impose an illegal sentence will not be specifically enforced (see People v Selikoff, 35 NY2d 227, 238, 241, cert den 419 US 1122; People v McClinton, 43 AD2d 930; Matter of Midgley v Smith, 63 AD2d 223; Matter of Vogler v Smith, 64 AD2d 824; Palermo v Warden, Green Haven State Prison, 545 F2d 286, cert dsmd 431 US 911; People v Fonville, 68 AD2d 916; People v Craig, 41 AD2d 932). Damiani, J. P., Lazer, Gulotta and Margett, JJ., concur.