Appeal from a judgment of the Supreme Court, Erie County (Penny M. Wolfgang, J.), rendered June 11, 2009. The judgment convicted defendant, upon his plea of guilty, of attempted criminal possession of a controlled substance in the third degree.
It is hereby ordered that the judgment so appealed from is unanimously modified on the law by vacating the sentence and as modified the judgment is affirmed, and the matter is remitted to Supreme Court, Erie County, for resentencing.
Memorandum: Defendant appeals from a judgment convicting him upon his plea of guilty of attempted criminal possession of a controlled substance in the third degree (Penal Law §§ 110.00, 220.16 [1]). Contrary to defendant’s contention, “the record does not establish that Supreme Court was unaware that it had the ability to exercise its discretion in determining whether to impose a lesser period of postrelease supervision” (People v Tyes, 9 AD3d 899 [2004], lv denied 3 NY3d 682 [2004]; cf. People v Stanley, 309 AD2d 1254, 1254-1255 [2003]).
We agree with defendant, however, that the court failed to apprehend the scope of its sentencing discretion in connection with the term of imprisonment to be imposed. During the plea proceeding conducted on February 27, 2007, the court agreed to sentence defendant to the “minimum sentence permitted by law[,] ... a determinate sentence of [SVa] years,” and the court informed defendant that it could impose the maximum sentence of “nine years” in the event that defendant violated a condition of the plea. In fact, however, the court had the discretion pursuant to the law in effect on that date to sentence defendant as a second felony drug offender to a determinate term of imprison*1325ment with a minimum of two years and a maximum of eight years (see Penal Law § 70.70 [3] [b] [former (ii)]). After he pleaded guilty, defendant failed to appear for sentencing and, on June 11, 2009, the court imposed an enhanced determinate sentence of five years imprisonment without any indication that it was aware of the permissible sentence range for defendant’s offense at that time, which after the amendment to Penal Law § 70.70 (3) (b) (ii) effective April 7, 2009 and applicable to defendant was a determinate term of imprisonment with a minimum of IV2 years and a maximum of eight years (see L 2009, ch 56, part AAA, §§ 23, 33 [f]). “ ‘The failure of the court to apprehend the extent of its discretion deprived defendant of the right to be sentenced as provided by law’ ” (People v Schafer, 19 AD3d 1133 [2005]). We therefore modify the judgment by vacating the sentence, and we remit the matter to Supreme Court for resentencing. In light of our determination, we do not address defendant’s challenge to the severity of the sentence. Present— Centra, J.P., Fahey, Lindley, Green and Martoche, JJ.