case should be restored to the Trial Calendar. Defense counsel argued that the granting of YO status to defendant was legal, that only the three- to nine-year sentence was illegal, and that the court could not vacate its grant of YO status. The court stated: “The sentence is illegal. The minute any portion of a sentence is illegal, I vacate the entire sentence. It is not severable.” It then adjourned the matter for further study. On December 4,1981 Justice Slavin vacated only the sentence of three to nine years’ imprisonment, stating “I am not vacating the youthful offender treatment portion of it.” In response, the prosecution stated: “Our position is the fact that the People’s agreement to take the plea for the lesser count was predicated on the three-to-nine. If the Court is not of a mind to impose a three-to-nine sentence, then it is our position that the defendant should be given the option either of accepting the sentence of three-to-nine without youthful offender treatment, or he should be offered the opportunity to withdraw his plea. That is our position.” Justice Slavin then imposed a sentence of one and one-third to four years and concluded: “The district attorney, without having to take it, has an exception to my sentence, and they say that I have not kept ‘the plea bargain’ so that if they see fit, they may take an appeal.” By order dated December 21, 1981, the court denied a motion by the prosecution to, in effect, vacate the resentence imposed on December 4,1981, upon the ground that it was invalid as a matter of law (CPL 440.40). The People have appealed from that order (CPL 450.20, subd 7). In
People v Farrar (
52 NY2d 302 ), the Court of Appeals held that the consent of the prosecution is required before the court may impose a sentence less than that originally agreed upon during the plea bargaining process. As stated by the court
(supra, pp 307-308): “Where the record shows that the prosecutor’s consent to a plea is premised on a negotiated sentence and a lesser sentence is later deemed more appropriate, the People should be given the opportunity to withdraw their consent. However justified the court’s unwillingness to impose the negotiated sentence, fairness dictates that this avenue be left open.” It is an accepted principle of law that the sentencing court must remain free to impose what it deems to be an appropriate sentence regardless of the agreement of the parties. The plea bargain agreed upon here was that defendant would plead guilty to attempted murder in the second degree, that a sentence of three to nine years would be imposed, and that YO treatment would be considered. On October 6,1981 the court attempted to impose the agreed-upon term of imprisonment, while still granting YO status. When the court subsequently learned that this could not be done, the prosecution clearly enunciated its consistent position that unless defendant agreed to forego YO treatment and accept a three- to nine-year sentence the plea was unacceptable and the matter should proceed to trial. Although the court stated that if any portion of a sentence that it had imposed was illegal, it would vacate the entire sentence, it adjourned the matter when defendant argued that the YO treatment, having been granted, could not be revoked. When the matter resumed on December 4, 1981 the court inexplicably stated that it was vacating the previously imposed prison term but not the YO treatment. This created a situation where the three- to nine-year sentence could not be imposed. Although inarticulately and ambiguously phrased, the prosecution once again expressed its refusal to consent to such a plea bargain by stating, in effect, that the court should either vacate defendant’s plea or impose a three- to nine-year sentence without YO treatment. Rather than resolving the conflict or putting the case back on the Trial Calendar, the court, with full knowledge that the prosecution did not consent to the plea bargain under the terms of the sentence it chose to impose, simply advised the prosecution to appeal. Pursuant to
People v Farrar ( 52 NY2d 302 ,
supra), the resentence imposed was illegal because it violated a