Before making his first appearance in court on drug charges Thursday, Capt. Dennis Linn resigned from the Twin Lakes Police Department.

Linn, 47, who was second in command at the department, was charged Feb. 26 with four counts of possession of narcotic drugs.

He is alleged to have taken prescription painkillers from the Twin Lakes Police Station — drugs that had been dropped off by residents in a program aimed at reducing opioid addiction.

He was charged after a detective at the police department became suspicious of Linn’s behavior in the evidence room where the collected prescription drugs were kept after Linn made statements about his wife’s painkiller prescription being cut off by her doctor.

Police Chief Adam Grosz asked for an investigation by the Wisconsin Department of Justice after officers with the department reported their suspicions.

Linn was charged after investigators found painkillers at his home that had been dropped off at the station by Twin Lakes residents.

Linn appeared in court with his attorney, and was released on a $10,000 signature bond. His bond carries conditions that bar him from contacting members of the Twin Lakes Police Department, from having weapons, or from having non-prescribed drugs.

His attorney, Ted Kmiec, declined to comment on the case after the hearing.

Grosz announced Thursday that Linn had resigned from the department on Tuesday.

The chief said Linn, who had been on administrative leave since the day the investigation was launched, was scheduled to come into the department Tuesday for an interview as part of an internal investigation to address his employment.

“He came in and submitted his resignation before making a statement,” Grosz said.

Linn had been a member of the department since 2002 and was a supervisor for many of those years, Grosz said.

He was also a member of the teaching staff at Gateway Technical College’s law enforcement program.

“It’s certainly disturbing and sad at the same time,” Grosz said of Linn’s alleged actions. “But I’m just very proud of my members who not only observed this behavior but immediately reported it. They did the right thing in a hard situation, and their integrity showed.”

Grosz said members of the police department “did the right thing when placed into a very difficult situation.”

Linn is charged in Kenosha County but the prosecution is being handled by an attorney from the Walworth County District Attorney’s Office.

Linn’s wife Cheryl was charged in Walworth County with possession of narcotics, possession of THC and possession of drug paraphernalia.

She was found with non-prescribed painkillers and marijuana after a search of her car and the couple’s Bloomfield home.

Dennis Linn is next expected in court March 28 for a preliminary hearing.