A California doctor known as the "Candy Man" has been convicted of illegally prescribing painkillers that authorities said led to the overdose deaths of 20 patients.

Dr. Julio Diaz was found guilty Friday in Santa Ana of 79 federal charges. He'd earlier pleaded guilty to 11 charges but withdrew his plea.

Prosecutors say Diaz — who ran a clinic in Santa Barbara — wrote addicts thousands of illegitimate prescriptions for powerful narcotics.

Diaz testified that he was tricked by patients who lied to get the drugs.

Prosecutors said some patients dubbed Diaz the "Candy Man" and contended that his prescriptions were connected to 20 deaths.

However, Diaz wasn't charged with any deaths.