To the shock of her lawyer, Dr. Diana Williamson, 56 years old, not only received three years’ prison time and an equal amount of post-release supervision, but Manhattan federal court judge Loretta Preska also ordered the doctor to begin serving the sentence immediately.

The judge also fined Dr. Williamson, who had pleaded guilty to drug conspiracy and health-care fraud charges in April, $17,500 and ordered her to pay more than $301,000 in restitution.

Outside the court, as Dr. Williamson’s crying sister dragged the doctor’s walker onto an elevator, defense attorney Jonathan Marks called it, “the saddest day I’ve ever seen in a courtroom.”

“I have never seen such an unfeeling reception from a judge in my entire career spanning 40 years,” he said. “I think this is shameful.”

Mr. Marks said that although the government’s forensic psychiatrist confirmed that Dr. Williamson suffered from multiple personality disorder, the judge “did not seem to understand either the nature of the illness or its significance.”

Dr. Williamson, once lauded for her work with poor AIDS patients, was arrested in August 2010 along with eight others and charged with being part of a yearlong oxycodone ring centered in a Harlem clinic that illegally distributed nearly 28,000 pills and defrauded Medicaid of more than $300,000.

Dr. Williamson was accused of writing prescriptions to people who didn’t need the painkillers, which were then sold to an alleged drug dealer.

Mr. Marks contended that one of Dr. Williamson’s dozen alternate personalities, “Nala,” was actually the one who negotiated with the accused drug dealer in the scheme and that the doctor “did not commit these crimes.”

Mr. Marks said the doctor was first diagnosed with dissociative identity disorder, which used to be known as multiple personality disorder, 25 years ago and that it is a coping mechanism related to being sexually abused as a child.

Despite that, she graduated from college and obtained both a medical and master’s degree. She also founded Crossroads Medical Research, an AIDS clinic in Brooklyn, as well as a research facility called Black AIDS Institute. In 1998, Crain’s New York Business profiled her work in its “40 Under Forty” issue.

In addition to the doctor’s “legendary work” in the field of AIDS, Mr. Marks also cited a litany of “life threatening” medical issues in asking for a non-prison sentence.

Dr. Williamson has long suffered from allergic asthma and pulmonary hypertension, her lawyer said. In addition, she had been released from the hospital just four days ago after being diagnosed with infectious colitis.

For months, the case against Dr. Williamson was held up while it was determined if the federal Bureau of Prisons had a prison with the medical facilities to handle Dr. Williamson’s myriad medical problems, for which she takes 30 different medications.

On Tuesday, prosecutor Justin Anderson produced a letter from the Bureau of Prisons saying they have a facility in Fort Worth, Texas, within a 10-minute drive of a major hospital.

“This has been a case of hurry up, hurry up and then delay, delay, delay,” the judge said. “The time has come.”

Mr. Marks says he plans to appeal, though the prosecutor told the judge that Dr. Williamson’s plea agreement precludes her from doing so.

“The sentence is monstrous,” Mr. Marks said. “It is tantamount to a death sentence.”