A doctor with a history of misconduct who lost his medical license three times was sentenced to seven years in prison Friday for running a clinic that prescribed opioids with little evaluation or oversight.

Shriharsh Pole, 65, pleaded guilty in federal court in Alexandria last year to a drug distribution conspiracy.

“I realize my mistake, and I sincerely apologize for it,” he told U.S. District Judge Claude M. Hilton. “It was a lack of judgment on my part.”

Over a four-year investigation, the clinic distributed 600,000 oxycodone pills. Customers at the clinic could simply show up with cash to get opioids, and some never were taken to an exam room, prosecutors said. Drug tests were infrequent, and failed tests were often ignored.

Pole’s medical license has been suspended since 2013 because of his freewheeling distribution of opioids, his second such infraction. He had hired another doctor and a nurse practitioner to keep his clinic running, according to his plea. The nurse, Janelle Hibson, 63, has pleaded guilty to the same charge. The other doctor, whose license was used to prescribe the opioids, has not been charged with a crime, and Pole’s defense attorneys said in court that that doctor was rarely in the office.

“There was no medicine going on there,” Assistant U.S. Attorney Michael Ben’Ary said in court. “It was just drug distribution.”

He noted that the U.S. attorney’s office has made such cases a priority.

As part of the office’s efforts, G. Zachary Terwilliger, the U.S. attorney for the Eastern District of Virginia, participated in a national prescription drug collection event Saturday.

State records sketch Pole’s history of violations.

His Virginia medical license was suspended in 2001.

Several times in the 1990s, according to state records documenting that suspension, female patients reported that Pole touched them in sexual ways, including “unnecessary and unusually long breast examinations” when he was on a fellowship at Georgetown University’s oncology department. According to the board review, in 1997 one of his patients died of a heart attack after Pole failed to do proper testing and evaluation for the patient’s chest and abdominal pain. Pole had also been reprimanded and fined by the Virginia Board of Medicine in 1996 for making false claims about his Georgetown record when trying to become licensed in Florida.

Pole was allowed to resume practicing in 2002 after the Virginia board found that he was complying with the terms of his suspension, including having a female chaperone present when he examined women.

In 2009, his license was suspended again when the board concluded that for the previous decade he had been prescribing opioids without proper examinations or follow-ups. His license was reinstated later that year after he took classes in addiction and record keeping.

In letters to the court, former patients said Pole was not a drug dealer disguised as a doctor but an attentive and compassionate physician who charged only what they could afford.

“Before this happened, Dr. Pole was a good doctor,” defense attorney Page Pate said in court. “He did care about his patients.”