GREENSBURG, Pa. (KDKA) – A Greensburg doctor accused of exchanging drugs for sex will spend more than three years behind bars.

Doctor Milad Shaker was convicted on 14 counts of illegally dispensing opioids last fall.

READ MORE: COVID-19 In Pennsylvania: State Health Dept. Announces 2,757 More Coronavirus Cases, 43 Additional Deaths

Shaker was accused of trading opioids for sexual favors in 2018.

According to testimony, he would meet the patient at various hotels around Westmoreland and Fayette counties to engage in sex in return for prescriptions like hydrocodone and percoset.

READ MORE: COVID-19 In Pittsburgh: Allegheny Co. Health Dept. Reports 9 Additional Deaths, 288 More Coronavirus Cases

He also was accused of exchanging prescriptions for sexually explicit photos of the patient.

In his defense, the Department of Justice says Shaker testified saying that “opioids are like candy” and “10 to 20 opioid pills will not hurt you”

MORE NEWS: KDKA Upgrading Transmitter To Enhance Viewer Experience

He was sentenced to 41 months in federal prison, 3 years of supervised release and will have to pay a $15,000 fine.