Story highlights Dr. Raymond Kraynak released from custody after posting $500,000 bond

Doctor allegedly wrote 2.7 million prescriptions for opioids within 19 months

(CNN) A Pennsylvania doctor charged with causing the deaths of five patients by unlawfully prescribing opioids surrendered his license to prescribe controlled substances at a federal court hearing Friday, officials said.

Dr. Raymond Kraynak -- whom prosecutors say prescribed nearly 3 million doses of opioids from January 2016 to July -- was released from custody Friday after posting a $500,000 bond, the US attorney's office for the Middle District of Pennsylvania said.

Kraynak awaits trial at a date yet to be determined.

Dr. Raymond Kraynak, here in 2014, faces charges related to the deaths of five patients.

Kraynak, 60, of Mount Carmel, was arrested Thursday. He is accused of, among other things, causing five deaths of patients between 2013 and 2015 by "unlawfully distributing and dispensing controlled substances" to them, according to the US Justice Department.

Prosecutors also allege that Kraynak, between 2005 and 2016, prescribed opioids "without a legitimate medical purpose' and "without conducting a proper medical examination," the US attorney's office said.