A pain-management doctor who prescribed massive amounts of opiates to patients at his northern Virginia clinic was sentenced Friday to nearly five years in prison.

Prosecutors had sought a life term for William E. Hurwitz, 61, who was convicted in April on 16 counts of drug trafficking. Authorities claimed Hurwitz crossed the line from doctor to drug dealer with his high-dose treatments.

U.S. District Judge Leonie Brinkema faulted Hurwitz for ignoring clear signals that some of his patients were obvious drug dealers or abusers, but she also credited him with saving lives with his willingness to prescribe the drugs to patients with debilitating pain.

Hurwitz initially was sentenced to 25 years in prison, but a federal appeals court overturned his 2004 conviction last year, ruling that a judge had improperly barred the jury from considering whether Hurwitz was acting in good faith.

Between 1998 and 2002, Hurwitz drew more than 400 patients from 39 states to his clinic in McLean for prescriptions for painkillers such as morphine and OxyContin.

He was an aggressive advocate of high-dose opiate treatment for patients, once touting his theories on the CBS news show "60 Minutes," and he become a hero to patient advocates who believe that doctors routinely under-treat chronic pain.

Brinkema said she had read news accounts of the first trial and had seen some of the massive prescriptions Hurwitz had given out, including one patient who was given 1,600 pills a day.

"The amount of drugs Dr. Hurwitz prescribed struck me as absolutely crazy," the judge said.

But after hearing testimony from both sides, "I totally turned around on that issue," Brinkema said. "The mere prescription of huge quantities of opioids doesn't mean anything."

The case against Hurwitz was part of a long-running federal, state and local investigation dubbed "Operation Cotton Candy" that netted more than 130 convictions in Virginia and elsewhere for drug trafficking and prescription fraud of Oxycontin and other drugs.