Dr. Mark Chavez was allowed to remain free on bond after conspiring to distribute surgical anesthetic ketamine to late actor Matthew Perry.

Chavez appeared in Los Angeles court on Friday after reaching a plea agreement earlier this month. U.S. Magistrate Judge Jean P. Rosenbluth told him he could remain free on bond with several restrictions, including turning over his passport and not working as a doctor.

Chavez did not enter his guilty plea or speak about the case, which he will do with another judge at a date to be determined.

Once he enters his guilty plea, Chavez could be sentenced to a maximum of 10 years in prison.

MATTHEW PERRY'S ASSISTANT, ‘KETAMINE QUEEN’ ATTEMPTED TO COVER UP STAR'S OVERDOSE: DOCS

Dr. Mark Chavez arrives at court

Dr. Mark Chavez, who is charged in connection with actor Matthew Perry's death from an accidental ketamine overdose, arrives at the Roybal Federal Courthouse in Los Angeles on Friday. (Associated Press)

Dr. Mark Chavez and his attorney wait for court to begin

Dr. Mark Chavez is seen with his attorney Matthew Binninger before his arraignment on Friday. (Associated Press)

While speaking to reporters outside the courthouse, Dr. Mark Chavez’s attorney, Matthew Binninger, said Chavez "is incredibly remorseful for what happened. Not just because it happened to Matthew Perry, but because it happened to a patient. He is trying to do everything in his power to right the wrong that happened here."

Binninger added that his client "didn’t accept responsibility today, but only because it wasn’t on the calendar," noting that he plans to do so at a change of plea hearing in the coming weeks.

Perry's death on Oct. 28 was caused by "acute effects of ketamine," according to his autopsy, which was completed on Oct. 29. Drowning, coronary artery disease and buprenorphine effects were listed as contributing factors.

Matthew Perry in a dark blue v-neck sweater soft smiles for the camera

One of the two doctors charged in connection to Matthew Perry's death appeared in court Friday. (Gregg DeGuire)

Chavez agreed to plead guilty to one count of conspiracy to distribute ketamine as part of his plea agreement. The San Diego-based doctor admitted to selling ketamine to Dr. Salvador Plasencia, including ketamine that he had diverted from his former clinic.

Chavez previously ran a ketamine clinic and allegedly submitted a bogus prescription in the name of a former patient to secure the drug. Plasencia allegedly taught Perry's assistant how to inject the actor with the drug.

Perry had been looking to find an additional ketamine source in the month before his death after the doctor he had been using wouldn't give him more of the drug, according to court documents obtained by Fox News Digital.

Matthew Perry's assistant received photos of ketamine lozenges

Some of the ketamine lozenges Matthew Perry's assistant, Kenneth Iwamasa, obtained were from a fraudulent prescription written by Dr. Mark Chavez, according to a plea agreement. (United States Attorney's Office)

LIKE WHAT YOU’RE READING? CLICK HERE FOR MORE ENTERTAINMENT NEWS

Perry came across Plasencia, who reached out to Chavez for the ketamine.

"I wonder how much this moron will pay," Plasencia texted Chavez, court documents showed. "Let's find out."

Plasencia pleaded not guilty and is awaiting trial.

Matthew LeBlanc, Matthew Perry, Jennifer Aniston and Courteney Cox in character on "Friends," all anxiously looking up at something

Matthew Perry was known for his role on the hit sitcom "Friends." (NBCU Photo Bank/NBCUniversal via Getty Images)

CLICK HERE TO SIGN UP FOR THE ENTERTAINMENT NEWSLETTER

Three others were charged in connection to Perry's death.

Perry's assistant, Kenneth Iwamasa, pleaded guilty on Aug. 7 to one count of conspiracy to distribute ketamine, causing death. Iwamasa admitted to repeatedly injecting Perry with ketamine without medical training, including performing multiple injections on the day Perry died.

US Attorney for the Central District of California Martin Estrada in a blue suit speaks behind a podium with many people standing behind him.

Martin Estrada, U.S. Attorney for the Central District of California, announced the arrests of five people in connection to Matthew Perry's death on Aug. 15. (Patrick T. Fallon/AFP via Getty Images)

Jasveen Sangha, aka "The Ketamine Queen," was charged with one count of conspiracy to distribute ketamine. She is also charged with one count of maintaining a drug-involved premises, one count of possession with intent to distribute methamphetamine, one count of possession with intent to distribute ketamine and five counts of distribution of ketamine.

Erik Fleming, who admitted to working as a middleman between Sangha and Iwamasa, pleaded guilty on Aug. 8 to one count of conspiracy to distribute ketamine and one count of distribution of ketamine resulting in death. Fleming admitted in court documents that he distributed the ketamine that killed Perry.

CLICK HERE TO GET THE FOX NEWS APP

Matthew Perry's assistant texted Erik Fleming about ketamine

Drug dealer Erik Fleming described the ketamine available to Perry and his assistant, Kenneth Iwamasa, in texts shown in the indictment. (United States Attorney's Office)

The ketamine allegedly provided by Sangha and delivered to Iwamasa by Fleming killed Perry on Oct. 28, according to court documents.

That morning, Perry's assistant administered a shot of ketamine to the actor around 8:30. By 12:45 p.m., Perry had instructed Iwamasa to give him another injection while the "Friends" star watched a movie. Roughly 40 minutes later, Perry requested another injection, allegedly telling Iwamasa, "Shoot me up with a big one," according to the plea agreement.

The live-in assistant administered a third injection to Perry while the 54-year-old was near or in a Jacuzzi. Iwamasa then left the home to run errands for Perry. When he returned, the assistant found Perry "face down" in the Jacuzzi, deceased.

The three then worked together to cover up their involvement in Perry's death, authorities alleged. 

Fox News Digital's Tracy Wright and The Associated Press contributed to this report.