Appeal from a judgment of the County Court of Schenectady County (Drago, J.), rendered June 8, 2011, convicting defendant upon his plea of guilty of the crime of criminal possession of a weapon in the second degree.
Following his attempted sale of a handgun to an undercover police officer, defendant pleaded guilty to one count of criminal possession of a weapon in the second degree and waived his right to appeal. County Court, as part of a negotiated plea agreement, thereafter sentenced defendant to a prison term of four years to be followed by four years of postrelease supervision and denied his request to be accorded youthful offender status. Defendant now appeals.
We affirm. Initially, we find that defendant’s waiver of his right to appeal was knowing, voluntary and intelligent. During the plea colloquy, County Court separately explained the nature of the appeal rights being waived and the consequences of doing so, and confirmed that defendant understood and agreed to *1154waive those rights. Additionally, defendant executed a written waiver in open court that acknowledged that he had discussed the waiver with counsel and understood the ramifications. Accordingly, we find that defendant’s waiver of his right to appeal his conviction and sentence was valid (see People v Lopez, 97 AD3d 853, 853 [2012], lv denied 19 NY3d 1027 [2012]; People v Clemons, 96 AD3d 1086, 1087 [2012]).
With respect to defendant’s remaining contentions, the valid waiver of his right to appeal precludes both his argument that County Court abused its discretion in denying his request to be sentenced as a youthful offender and the challenge to the severity of his sentence (see People v Dixon, 93 AD3d 894, 896 [2012]; People v Brabham, 83 AD3d 1225, 1225 [2011]; People v Cullen, 62 AD3d 1155, 1157 [2009], lv denied 13 NY3d 795 [2009]).
Rose, Malone Jr., Stein and Egan Jr., JJ., concur. Ordered that the judgment is affirmed.