A doctor was arrested at a medical office in San Diego’s East County Wednesday, accused of trying to hook patients onto painkillers and prescribing the pills in exchange for sex once those patients were addicted.

United States Drug Enforcement Administration (DEA) spokesperson Amy Roderick told NBC 7 that Dr. Naga Raja Thota, M.D., was arrested at the Pain Management Center located at 2732 Navajo Rd. in El Cajon during a raid by federal authorities.

Thota was arraigned in federal court Wednesday afternoon before U.S. Magistrate Judge Bernie Skomal. He is being represented by San Diego-based attorney Robert Schlein, who has been his attorney for the past two years.

The judge set Thota's bail at $100,000. The doctor was also ordered to not contact any of the patients involved in the case.

Roderick said Thota, 62, allegedly prescribed opiate painkiller medication to patients with the intent of getting them addicted. Roderick told NBC 7 that once patients were addicted, Thota would ask patients to engage in sexual relations with him in exchange for more prescriptions.

The female patients involved in this case received prescriptions for the opioids without legitimate medical purpose, on numerous occasions, in exchange for sex acts, the office of United States Attorney Laura E. Duffy confirmed.

NBC 7 spoke with Tom Lenox of the DEA Wednesday who said the federal investigation on Thota dates back several years.

Lenox said it involves three patients in their early to mid-20s who were prescribed painkillers by the doctor and developed sexual relationships with him.

Lenox said the doctor would, in some cases, order a prescription under the name of a family member of a patient to avoid a "red flag" from prescribing too many medications over a short period of time for one patient.

Two of Thota’s patients later became addicted to heroin due to the over-prescribing of painkillers, Lenox said.

The U.S. Attorney's office the main patient outlined in the federal complaint, referred to as "J.S.," met Thota when she was 20 years old and felt that if she did not submit to sex acts with the doctor, Thota would not provide her with additional prescriptions for opioids.

She started using heroin after "being exposed to greater dosage levels of opioids by Thota," the U.S. Attorney's office said in a document outlining the charges against Thota.

The doctor is charged with seven counts of dispensing controlled substances without a legitimate medical purpose. If convicted on all charges, Thota faces a maximum sentence of 20 years behind bars, plus a $1 million fine and life-term of supervised release.

A federal complaint filed against Thota on Tuesday states he prescribed Hydrocodone, Oxycodone, Methadone and Alprazolam to J.S. at least 33 times between March 2013 and February 2014. In one instance, Thota prescribed 300 Oxycodone pills for the woman.

The complaint shows the doctor engaged in a pattern of sending "sexually-explicit texts" with J.S., followed by writing prescriptions for the highly-addictive painkillers. He often called the patient "babe" and "love" in the text messages.

The complaint says J.S. told investigators that her romantic relationship with Thota began three days after her first consultation with him, when he called her cell phone to ask if she had a date for Valentine's Day. After that, they began communicating regularly via phone calls and text messages.

Later on in their relationship, according to the complaint, J.S. asked Thota to write a prescription for painkillers for her brother and Thota sent the woman a text message saying no because he was "scared" to lose his license to practice medicine.

However, without ever establishing a patient-doctor relationship with J.S.'s brother, Thota wound up writing prescriptions for the woman's brother three times in 2013, the complaint states.

During a six-week period between March 2013 and April 2013, Thota also allegedly prescribed painkillers in the name of J.S.'s father and one of her friends. The complaint says that during that time period 1,460 Oxycodone pills and 660 tablets of Hydrocodone were prescribed by Thota.

Federal investigators reviewed Thota's cell phone records and found set of text messages between the doctor and another patient, referred to as "D.H." between May 2014 and September 2014, the complaint says.

D.H. told investigators Thota had texted her on numerous occasions to ask her for sex, allegedly offering to pay her $100 to have sex with him.

Another patient included in the complaint, referred to as "M.R.," communicated with Thota via cell phone between February 2013 and February 2014.

During that time period, the complaint says Thota wrote 59 prescriptions for painkillers for M.R. and even met her in the parking lot of a CVS once to give her a prescription and $50 to fill it.

The woman also told investigators that Thota would sometimes drive her "from pharmacy to pharmacy to see which one we could get to do it [fill the prescription]."

M.R. told agents she also engaged in sexual acts with Thota in exchange for the prescriptions. She said Thota would also buy her expensive gifts, including diamond earrings, a smartphone, shopping sprees and a weekly $50 gift card to Starbucks. He also helped her pay off her car.

After becoming addicted to methadone, M.R. also became hooked on heroin, the documents state. The patients involved in this federal case against Thota are all still alive, Lenox confirmed.

Federal agents served the first search warrants in this investigation on Thota's medical practice on Navajo Road on May 27, 2015. The doctor was first interviewed by investigators at the U.S. Attorney's Office in San Diego on June 4, 2015, mainly about prescriptions he wrote for patients mentioned in the complaint. He met again with the feds on Dec. 15, 2015, while in the presence of his defense attorney, the complaint says.

Search warrants were served on Thota's medical practice on Navajo Road on March 16, 2016. During that search, federal agents discovered more text messages between Thota and one of the patients in the complaint, plus nude photos of another patient in the complaint.

Read the full complaint filed on Aug. 30 here.

Past Complaints Against Thota

According to Superior Court of California records obtained by NBC 7, Thota has been involved in two medical malpractice cases and one professional negligence case in San Diego County.

One malpractice case was filed in May 2013 by the family of an elderly patient who was treated by Thota.

According to that complaint, on Oct. 30, 2012 Thota allegedly performed a kyphoplasty procedure on that elderly patient "without obtaining proper informed consent from her son." The complaint said the patient suffered from Dementia and "lacked the capacity to understand and make decisions."

The document said Thota "recklessly" performed the procedure at an office rather than a surgical center and punctured one of the victim's veins. The family said the doctor failed to properly repair the vein.

The elderly woman was returned to her nursing home, where she experienced complications stemming from the kyphoplasty the following day. She was hospitalized and died on Nov. 5, 2012, according to the complaint.

A second malpractice complaint was filed against Thota in August 2013. The document said he worked for Sharp Healthcare at that time.

The complaint said Thota “surgically removed a nonfunctioning dorsal column stimulator, internal pulse generator and leads from the lower back of plaintiff” during a procedure at Grossmont Hospital in La Mesa.

The doctor also allegedly left some tubing inside the patient’s lower back during the procedure that served “no therapeutic purpose.”

The complaint said that, as a result of Thota’s work, that patient suffered “severe shock and injury to her nervous system and person.”

A professional negligence complaint against the doctor was filed in April 2016.

Those documents show Thota was working at the Pain Management Center on Navajo Road – the same place that was raided Wednesday – at the time when that case was filed.

Thota's Medical License

According to the Medical Board of California, Thota has a current "Physician and Surgeon A" license to practice that expires on Aug. 31, 2018. His license was issued on Sept. 14, 1994. It states Thota graduated from Dr. NTR University of Health Sciences in Vijayawada in India on Jan. 1, 1979.

The Medical Board of California license information shows one "administrative disciplinary action" on Thota's record and lists his status as "probation" as a result of disciplinary action. The license also says "limitations have been placed on the physician's practice."

Thota was placed on probation effective March 2, 2016, according to the Medical Board of California. He was suspended from practicing for one month, from March 18 to April 16. Per the Board, Thota's probation term is seven years.

The probation terms state he is "prohibited from engaging in the solo practice of medicine and supervising physician assistants and shall not order, prescribe, dispense, administer, furnish of possess any controlled subtances, except for those drugs listed in schedules IV and V. Dr. Thota shall be subject to this restriction until he completes a prescribing course."

Meanwhile, the Pain Management Center on Navajo Road continued to operate following Thota’s arrest on Wednesday.

NBC 7 spoke with several patients at the facility who said they like the doctor and never had any issues with Thota. Patient reviews for Thota on this website show he has a 3.5 rating out of 5.

However, a couple of former patients of Thota's not involved in this case told NBC 7 their encounters with the doctor were uncomfortable.

One woman said he made sexual advances toward her.

“He said 'I'm going to help you' and he threw his arms around me and grabbed me up against him and he kissed the side of my face,” Anne Lutz explainec.

Another former patient who wished not to be identified, said she followed Thota's advice and in no time, she became addicted to Oxycodone.

"My body was becoming dependent on it. I needed it. When I woke up and I didn't have it, I felt awful," she recounted.

After Wednesday's hearing, a judge determined Thota could still work at his pratice but with some restrictions. He is still able to prescribe pain medicine to female patients, but only under the supervision of another physician while this case is pending, Judge Skomal said.

That decision is leaving some former patients outraged.

The investigation is ongoing. Lenox said there may be more victims out there. Roderick said anyone who believes they are victims of Thota in this case can call federal law enforcement at (858) 616-4100.

Thota is scheduled to appear in court again on Sept. 13.