CARPINELLO, J.
In satisfaction of a charge of rape in the first degree, a class B violent felony, defendant entered a plea of guilty of attempted rape in the first degree, a class C violent felony, with the understanding that he would be sentenced to a determinate prison term of 5 1/2 years. Defendant was sentenced as agreed and he executed a waiver of the right to appeal. He now appeals, challenging the sentence.
While defendant's unlimited waiver of the right to appeal does not foreclose a challenge to the legality of the sentence, it does encompass a challenge to the sentence as harsh and excessive (see, People v. Hidalgo, 91 N.Y.2d 733). Defendant's sentence was clearly authorized (see, Penal Law § 70.02[a]; [3][b]) and he claims only that it is harsh and excessive. The issue, therefore, has not been preserved for our review.
In any event, defendant was permitted to plead to a class C violent felony in satisfaction of the pending class B violent felony charge and the allocution indicates that defendant committed the greater crime. In addition, the 5 1/2-year prison term was considerably less than the 15-year maximum possible term for a class C violent felony (see, Penal Law § 70.02[b]). Accordingly, despite defendant's youth and lack of a criminal record, there is no basis to disturb the sentence even if defendant's challenge had not been encompassed by his waiver of the right to appeal.
MERCURE, J.P., CREW III, SPAIN and MUGGLIN, JJ., concur.
ORDERED that the judgment is affirmed.