*706Appeal by the defendant from a judgment of the County Court, Orange County (Freehill, J.), rendered June 13, 2011, convicting him of grand larceny in the third degree, upon his plea of guilty, and imposing an indeterminate term of imprisonment of 2 to 6 years.
Ordered that the judgment is modified, as a matter of discretion in the interest of justice, by vacating the sentence imposed thereon; as so modified, the judgment is affirmed, and the matter is remitted to the County Court, Orange County, for further proceedings consistent herewith.
The defendant pleaded guilty to grand larceny in the third degree in exchange for, among other things, imposition of an indeterminate term of imprisonment of 1 to 3 years. The County Court promised to impose that sentence if the defendant did not commit further crimes before he was sentenced, and he cooperated in the preparation of a presentencing report. The court also reserved the right to allow the defendant to withdraw his plea of guilty if the content of the presentence report rendered the court “unable” to impose the promised sentence. Before the defendant was sentenced, however, the court permitted him to enter a drug-treatment program. Although mention was made of the possibility that the defendant would be treated more leniently upon his successful completion of the program, the plea agreement was not modified to provide for imposition of a longer sentence in the event the defendant did not successfully complete the program. The defendant did not successfully complete the program, and the court imposed an indeterminate term of imprisonment of 2 to 6 years without first affording him the opportunity to withdraw his plea of guilty. Without any indication that the defendant violated the terms of the plea agreement, he was entitled to imposition of the agreed-upon sentence or the opportunity to withdraw his plea of guilty before consenting to a longer sentence based on the content of the presentence report (see People v Sauer, 8 AD3d 302 [2004]; People v Fulton, 238 AD2d 439, 440 [1997]; People v McKane, 227 AD2d 503, 503-504 [1996]). Although the defendant failed to preserve this claim for appellate review (see CPL 470.05 [2]; People v Murray, 15 NY3d 725 [2010]; cf. People v McAlpin, 17 NY3d 936 [2011]), we review it in the exercise of our interest of justice jurisdiction (see CPL 470.15 [6] [a]). Accordingly, we vacate the defendant’s sentence and the matter is remitted to the County Court, Orange County, to afford the defendant the opportunity to withdraw his plea of guilty, if he be so advised, or for the imposition of the agreed-upon sentence. Balkin, J.P., Roman, Sgroi and Cohen, JJ., concur.