A man who illegally sold prescriptions for opioid pain pills from a sham clinic he owned in Long Beach was sentenced today to 39 months behind bars.

James Wilson, 56, of Venice, also was ordered by U.S. District Judge Terry Hatter Jr. to serve three years on supervised release after he gets out of federal prison. The judge said the defendant must participate in drug abuse treatment while behind bars and during his court-ordered supervision.

Hatter initially handed Wilson a 51-month term, but shaved off a year due to his attendance at drug abuse counseling sessions and his successful effort to stay free of narcotics.

“You have an illness,” Hatter said from the bench.

Wilson was convicted by the judge in March of two federal counts of distribution of oxycodone.

Prosecutors said Wilson, who is not a physician or pharmacist, wrote and sold four prescriptions, each for 120 tablets of maximum-strength immediate-release oxycodone, to a person he believed to be a drug customer but was in fact a confidential informant working with the U.S. Drug Enforcement Administration.

Wilson received $200 for each of the four prescriptions he sold. Law enforcement found 160 partially completed prescriptions, each for 120 pills, in the defendant’s car at the time of his arrest in August 2017, according to the U.S. Attorney’s Office.

“That would be 20,000 diverted oxycodone pills” if the prescriptions had been sold and filled, Assistant U.S. Attorney Brittney Harris told the court.

Wilson’s lawyer, Joel Koury, said the defendant has a lengthy history of substance abuse and would benefit from drug abuse treatment while in custody.

In a statement to the court, Wilson said that since his arrest, he has been supporting himself by driving for Uber and Lyft.

“That’s a danger to society right there,” the judge said.

But Wilson—who was ordered to surrender Jan. 21 to begin his sentence—responded that he has been regularly screened while awaiting sentencing and has remained clean.