In western Virginia, far from the limelight, United States Attorney John L. Brownlee found himself on the telephone last year with a political and legal superstar, Rudolph W. Giuliani.

For years, Mr. Brownlee and his small team had been building a case that the maker of the painkiller OxyContin had misled the public when it claimed the drug was less prone to abuse than competing narcotics. The drug was believed to be a factor in hundreds of deaths involving its abuse.

Mr. Giuliani, celebrated for his stewardship of New York City after 9/11, soon told the prosecutors they were wrong.

In 2002, the drug maker, Purdue Pharma of Stamford, Conn., hired Mr. Giuliani and his consulting firm, Giuliani Partners, to help stem the controversy about OxyContin. Among Mr. Giuliani’s missions was the job of convincing public officials that they could trust Purdue because they could trust him.