Marlene O. Tuczinski, Chatham, for appellant. Mary E. Saitta, Special Prosecutor, Binghamton, for respondent. Appeal from a judgment of the County Court of Broome County (Kevin P. Dooley, J.), rendered December 20, 2021, which revoked defendant’s probation and imposed a sentence of imprisonment. In 2018, defendant waived indictment and pleaded guilty to attempted robbery in the second degree in satisfaction of two separate robbery charges. Pursuant to the plea agreement, County Court imposed a five-year period of probation. Within a month, defendant was charged with violating probation following his arrest for criminal possession of a weapon, to which he pleaded guilty in Binghamton City Court and received a jail sentence; County Court continued him on probation. In October 2020, defendant again violated probation when he was charged with driving while ability impaired by drugs. On February 4, 2021, County Court advised defendant, after several discussions with defense counsel and the People, that it had agreed to sentence defendant to a prison term of three years, to be followed by three years of postrelease supervision (hereinafter PRS), upon his admission to violating probation, which defendant accepted. At defense counsel’s request, sentencing was adjourned for the court to consider a presentencing memorandum, at which time the court advised defendant that it would consider its contents but that it was still likely that defendant would be sentenced to the three-year prison term. At an appearance two weeks later, and as requested in the presentencing memorandum, defendant asked that, in lieu of sentencing at that time, County Court permit him to enter a long-term drug treatment program with the hope of being permitted to return to probation and avoid any time in prison. The court warned defendant that it would grant his request only if defendant affirmed his understanding and agreement that if he failed to abide by the conditions of his probation and successfully complete the program, the court would not be bound by the previously discussed three-year prison term and could impose a prison term of up to seven years. Defense counsel confirmed that he had discussed those terms with defendant, who indicated that he understood and agreed. At sentencing in December 2021, defendant admitted that he had been unsuccessfully discharged from the drug treatment program and the court consequently discharged him from probation and imposed a prison term of 4½ years, to be followed by three years of PRS, upon his conviction of attempted robbery in the second degree. Defendant appeals. We affirm, as we are not persuaded by defendant’s argument that the resentence imposed following his repeated probation violations and commission of additional crimes was unduly harsh or severe (see CPL 470.15 [6] [b]). Initially, in consideration of a favorable probation report, his full-time employment and other mitigating factors, defendant was shown leniency when he received probation for his guilty plea in satisfaction of an armed robbery in which he held a gun to the victim’s head and another robbery in which the victim was injured, and probation was restored after he admittedly violated probation just weeks later by possessing a weapon. The instant probation violation occurred when defendant was found in his running car, having overdosed on drugs, for which County Court capped the prison resentence at three years, to be followed by three years of PRS, in exchange for defendant’s admission. The court thereafter granted defendant’s request to enter a drug treatment program, but expressly conditioned the previously-promised sentencing cap on his successful completion of that program and compliance with the conditions of probation, warning him that he would face up to seven years in prison if he failed to do so. Contrary to defendant’s claim, under the conditions to which he had agreed in exchange for the opportunity to participate in a treatment program, the court was not bound to the previously agreed to three-year prison term when he was kicked out of that program. Furthermore, defendant was not punished for entering treatment, as he argues, and it was eminently reasonable for the court to condition further postadmission postponements of resentencing and the contemplated sentencing cap on his successful completion of the treatment program that defendant had requested (see generally People v. McMillan, 166 AD3d 1231, 1232 [3d Dept 2018]; People v. Stubbs, 75 AD3d 664, 665 [3d Dept 2010]). The court’s imposition of a higher, 4½-year resentence, which is less than the maximum seven-year prison term permitted for this violent felony (see Penal Law §§ 70.02 [1] [c]; [3] [c]; 160.10), was a consequence of the seriousness of the conduct underlying the robbery charges and defendant’s repeated probation violations and other misconduct while on probation. Under these circumstances, we decline defendant’s request to modify the resentence in the interest of justice (see CPL 470.15 [3] [c]). Aarons, J.P., Lynch, Ceresia and Mackey, JJ., concur. ORDERED that the judgment is affirmed.