An Illinois state representative resigned on Wednesday hours after a report about allegations that he posted nude photographs of his ex-girlfriend on Instagram without her consent in an effort to draw other men into “graphic” conversations.

The lawmaker, Nick Sauer, a Republican who had served on the State Legislature’s task force to combat sexual discrimination and harassment, was the subject of a complaint filed by his ex-girlfriend with the state’s Office of the Legislative Inspector General, according to a report by Politico.

The complaint accused Mr. Sauer of using an Instagram account filled with nude images of his ex-girlfriend, Kate Kelly, to “catfish” other men, or lure them into an online relationship using a fake persona.

“As a result of the allegations by Kate Kelly, a former girlfriend, I have decided to resign my office,” Mr. Sauer wrote in his letter of resignation to the clerk of the Illinois House, where he represented the 51st District, which includes affluent suburbs north of Chicago. “My ability to fulfill my obligations as a State Representative and public servant will be affected by the distraction of addressing these allegations.”