GREENEVILLE, Tenn. (AP) — A former circuit judge in Tennessee has been sentenced to six months in federal prison for lying to cover up a scheme that provided him with painkillers and sex.

A federal judge sentenced Richard Baumgartner on Wednesday. The former judge in Knox County was convicted in November of five counts of misprision of a felony. He was accused of lying to cover up a conspiracy involving a defendant from his court supplying him with pills and sex.

Baumgartner resigned his judgeship and pleaded guilty in March 2011 to a state charge of official misconduct after a probe found he bought pills from the felon. He did not receive prison time for that charge.

Prosecutors say Baumgartner was so addicted that he was having sex and buying pills during courtroom breaks.