A former medical examiner pleaded guilty in federal court to giving prescriptions for opioid drugs to women with whom he was romantically involved and who then sold them, the U.S. attorney in Atlanta announced Wednesday.

“This defendant traded prescriptions for sex and is responsible for distributing thousands of doses of dangerous opioids within our community,” U.S. Attorney Byung J. “BJay” Pak said in a news release. “We are grateful for the dedicated work of our local and federal law enforcement partners who are equally committed to the arrest and prosecution of those who seek to profit from unlawfully distributing these drugs.”