A western New York teacher has pleaded guilty to sodomy involving a 13-year-old boy.

Anthony Harper resigned from his job as a West Seneca East Middle School French teacher and wrestling coach during his state Supreme Court hearing Tuesday and was ordered to surrender his New York teacher's certificate.

The 34-year-old faces up to seven years in prison after pleading guilty to a charge of criminal sexual act.

Harper taught in the suburban Buffalo district from 1998 until being suspended following his arrest last August.

He declined to comment after the hearing. In court, he replied "yes" when the judge asked whether he had committed an "oral sexual act" on the boy.