
    The People of the State of New York, Respondent, v Keenan Twiggs, Appellant.
   Appeal from a judgment of the County Court of Albany County, rendered October 8, 1976, convicting defendant, upon his plea of guilty, of the crime of grand larceny in the third degree and sentencing him to a term of imprisonment of not less then one and one-half nor more than three years as a predicate felon. The sole issue on this appeal is whether the defendant should have been permitted to withdraw his plea of guilty. The record before us discloses that defendant’s guilty plea was based on an agreement between the defendant’s attorney, the District Attorney’s office, and the court that the defendant would receive a sentence of one year in the Albany County jail upon his plea of guilty. At the sentencing, in response to defendant’s motion to withdraw his guilty plea, the court stated: "The Court at the time of accepting the plea indicated to the defendant as a result of plea negotiations, all things being equal, this Court would impose a sentence of one year in the Albany County Jail. Obviously, all things are not equal since the defendant is a predicate felon under our law and, by operation of law, must be sentenced to a minimum of imprisonment.” While withdrawal of a plea is within the discretion of the trial court, where, as here, an understanding was reached at the time the defendant entered his plea that he would receive a particular sentence, which the court was powerless to impose when the defendant was thereafter charged with being a predicate felon, the defendant is entitled to an opportunity to withdraw his plea of guilty and stand trial (People v Selikoff, 35 NY2d 227, 238-239; People v Ransom, 55 AD2d 980, 981; People v Bailey, 50 AD2d 522). Judgment reversed, on the law, and matter remitted to the County Court of Albany County for further proceedings not inconsistent herewith. Koreman, P. J., Greenblott, Sweeney, Mahoney and Main, JJ., concur.  