A Pennsylvania mayor who claimed he had been set up after his arrest on prostitution charges has resigned from office, officials said Thursday.

Bloomsburg Mayor Eric Bower, 36, was arrested April 20 at a Hampton Inn after he showed up with $200 cash and condoms, according to a police affidavit. Police said he had paid a state police informant for sex on several occasions, most recently in early April.

A day after his arrest on four misdemeanor prostitution counts, Bower told WNEP-TV the woman was a friend with whom he had a “very playful, you know, relationship.” He said he planned to fight the charges.

“I believe this was just a setup because of my political position,” Bower said.

State police troopers said in an affidavit they discovered “during the course of an ongoing investigation” that Bower had been paying for sex from one of their confidential informants. Police did not say more about the nature of the probe.

Bower, a Democrat, was elected in November.

On Thursday, he waived a preliminary hearing on the charges and vacated the mayor’s office, Pennsylvania Attorney General Josh Shapiro said in a news release. He also stepped down from his post as a state constable.

“This mayor flouted the law and solicited sex from a prostitute on multiple occasions,” Shapiro said.

Bower’s attorney, Patrick O’Connell, said that Bower resigned for the good of Bloomsburg, a college town of more than 14,000 about 130 miles northwest of Philadelphia.

“The town of Bloomsburg needs to focus on the tasks that it needs to focus on, running an efficient local government, which is challenging enough. But these charges caused a circus environment. Eric Bower recognized that and for the better of the town, decided to resign,” O’Connell said.

O’Connell declined comment on whether Bower still planned to contest the charges.

Bower did not immediately return a call for comment.