CHATTANOOGA, Tenn. (AP) — A Tennessee Highway Patrol captain has resigned following an investigation into a relationship he had with a subordinate for several years.

WTVC-TV reports that audio recordings obtained through a public records request show that Captain Jeffrey Mosley confirmed the sexual relationship with a dispatcher while being questioned by investigators.

Investigators concluded that Mosley met with a dispatcher at a motel several times while he was still on duty, in uniform and driving a state-issued vehicle. He also said he swapped nude photos with the dispatcher.

Mosley resigned Dec.5, the same day he was questioned in the investigation. He signed a notice stating that he was resigning “in lieu of termination.”

Investigators questioned Mosley after receiving an anonymous complaint, which was included in Mosley’s investigative file provided to the news outlet.

The complaint read that “After learning of this matter, I realized the taxpayers of this State are funding” the affair.

Mosley had worked for the THP for more than 30 years. He was promoted to lead the Chattanooga THP office in 2015 and described as an “up and coming leader.” Documents show that Mosley and the dispatcher began their relationship within a few months of his promotion.

THP didn’t immediately return a request for comment.