Appeal from a judgment (denominated order) of the Supreme Court, Livingston County (Robert B. Wiggins, A.J.), entered October 25, 2010 in a habeas corpus proceeding. The judgment denied the petition.
It is hereby ordered that the judgment so appealed from is unanimously reversed on the law without costs and the writ of habeas corpus is sustained, and
It is further ordered that respondent is directed to discharge petitioner from custody forthwith.
Memorandum: Petitioner commenced this habeas corpus proceeding alleging that he was unlawfully subjected to a period of postrelease supervision that was imposed administratively by the New York State Department of Corrections and Community Supervision (DOCCS) rather than by the sentencing court. We agree.
Only a sentencing court may impose a period of postrelease supervision and DOCCS cannot remedy a court’s failure to impose it by administrative action (see CPL 380.20, 380.40 [1]; Matter of Garner v New York State Dept. of Correctional Servs., 10 NY3d 358, 360 [2008]). Sentencing is a critical stage of criminal proceedings (see People v Harris, 79 NY2d 909, 910 [1992]), and a defendant has “a statutory right to hear the court’s pronouncement as to what the entire sentence encompasses, directly from the court” (People v Sparber, 10 NY3d 457, 470 [2008]). At sentencing in this case, the court stated that “the supervisory period under the violent felony offender sentencing *1134statute will be five years, which means when you come out on parole, you will be on five years of parole at the conclusion of the ten-year sentence.” We conclude that the court did not pronounce the period of postrelease supervision at sentencing as required by CPL 380.20 and 380.40 (1), and thus petitioner was not sentenced to a period of postrelease supervision (see People ex rel. Lewis v Warden, Otis Baum Correctional Ctr, 51 AD3d 512, 512 [2008]). Because petitioner served his sentence, he must be immediately released. Present — Smith, J.P, Fahey, Valentino, Whalen and Martoche, JJ.