A Ken-Ton middle school teacher resigned his job Wednesday after pleading guilty to felony charges involving sending a lewd photo to a student via cellphone.

William Kuhn, 42, of Town of Tonawanda, pleaded guilty to disseminating indecent material to minors, a second-degree felony.

This is the highest charge for which he could have been convicted had he gone to trial, according to the District Attorney’s Office.

Kuhn confessed to sending a photo of his genitalia via cellphone to a 14-year-old student in April.

Kuhn, who taught and was the band director at Kenmore Middle School, was placed on administrative leave by the school district in May.

Along with his resignation, Kuhn was required to surrender his state teaching license as part of the plea.

He faces a maximum prison sentence of 1 1/3 to 4 years when he is sentenced Oct. 24 by County Judge Kenneth F. Case.

Mark P. Mondanaro, superintendent of the Kenmore-Town of Tonawanda School District, wrote to district parents about the guilty plea.

“I want the parents and this community to be assured that when concerns were first brought to the district’s attention Mr. Kuhn was immediately removed from the classroom as well as the district’s buildings and (contact with) students, the matter was reported to law enforcement, and the district cooperated and worked with those entities,” Mondanaro wrote.

Rosanne E. Johnson, chief of the district attorney’s Special Victims Bureau, prosecuted the case.