Appeal from a judgment of the County Court of Schenectady County (Feldstein, J.), rendered June 3, 1992, convicting defendant upon his plea of guilty of the crime of attempted criminal possession of a controlled substance in the fourth degree.
Defendant initially pleaded guilty to the crime of attempted criminal possession of a controlled substance in the fourth degree in satisfaction of a two-count indictment charging more serious crimes in exchange for an agreed-upon sentence of 2 to 4 years’ imprisonment. While being held pending sentencing, however, defendant was involved in an incident at the Schenectady County Jail which resulted in his pleading guilty to the crime of assault in the third degree. Consequently, County Court indicated at sentencing that it was no longer willing to impose the sentence agreed to and gave defendant an opportunity to either withdraw his plea or accept a sentence of 2Vz to 5 years’ imprisonment. Defendant ultimately agreed to the increased sentence and now appeals, contending that County Court erred in failing to abide by the terms of the original plea agreement and that the sentence is harsh and excessive.
We affirm. A sentencing court retains its discretion to impose an appropriate sentence until the time of sentencing (see, People v Schultz, 73 NY2d 757; People v Walker, 187 AD2d 909; People v Wade, 153 AD2d 969). Defendant’s additional criminal activity while awaiting sentencing clearly provided County Court with sufficient reason to depart from the agreed-upon sentence (see, People v Wade, supra). Given that defendant does not allege that he detrimentally relied upon the original sentencing agreement and was offered and rejected the opportunity to withdraw his plea, we cannot find that County Court abused its discretion in sentencing defendant (see, People v Schultz, supra). Nor can we find any reason to disturb the sentence imposed in light of defendant’s plea agreement, his prior criminal record and his conduct while awaiting sentencing (see, People v Mackey, 136 AD2d 780, lv denied 71 NY2d 899).
Weiss, P. J., Levine, Mercure, Mahoney and Casey, JJ., concur. Ordered that the judgment is affirmed.