His death was confirmed by Susan A. Wills, an assistant at the Geisel School of Medicine at Dartmouth College, which has an institute named after Dr. Koop. In 1981, Dr. Koop had never served in public office when President Ronald Reagan appointed him surgeon general of the United States. By the time he stepped down in 1989, he had become a household name, a rare distinction for a public health administrator.

Dr. Koop issued emphatic warnings about the dangers of smoking, and he almost single-handedly pushed the government into taking a more aggressive stand against AIDS. And despite his steadfast moral opposition to abortion, he refused to use his office as a pulpit from which to preach against it.

These stands led many liberals who had bitterly opposed his nomination to praise him, and many conservatives who had supported his appointment to vilify him. Conservative politicians representing tobacco-growing states were among his harshest critics, and many Americans, for moral or religious reasons, were upset by his public programs to fight AIDS and felt betrayed by his relative silence on abortion.

As much as anyone, it was Dr. Koop who took the lead in trying to wean Americans off smoking, and he did so in imposing fashion. At a sturdy 6-foot-1, with his bushy gray biblical beard, Dr. Koop would appear before television cameras in the gold-braided dark-blue uniform of a vice admiral — the surgeon general's official uniform, which he revived — and sternly warn of the terrible consequences of smoking.

"Smoking kills 300,000 Americans a year," he said in one talk. "Smokers are 10 times more likely to develop lung cancer than nonsmokers, two times more likely to develop heart disease. Smoking a pack a day takes six years off a person's life."

When Dr. Koop took office, 33 percent of Americans smoked; when he left, the percentage had dropped to 26. By 1987, 40 states had restricted smoking in public places, 33 had prohibited it on public conveyances and 17 had banned it in offices and other work sites. More than 800 local antismoking ordinances had been passed, and the federal government had restricted smoking in 6,800 federal buildings. Antismoking campaigns by private groups like the American Lung Association and the American Heart Association had accelerated.

Dr. Koop also played a major role in educating Americans about AIDS. Though he believed that the nation had been slow in facing the crisis, he extolled its efforts once it did, particularly in identifying H.I.V., the virus that causes the disease, and developing a blood test to detect it.

Where he failed, in his own view, was to interest either Reagan or his successor as president, George Bush, in making health care available to more Americans.

Dr. Koop was completing a successful career as a pioneer in pediatric surgery when he was nominated for surgeon general, having caught the attention of conservatives with a series of seminars, films and books in collaboration with the theologian Francis Schaeffer that expressed anti-abortion views.

At his confirmation hearings, Senate liberals mounted a fierce fight against him. Senator Edward M. Kennedy, Democrat of Massachusetts, said Dr. Koop, in denying a right to abortion, adhered to a "cruel, outdated and patronizing stereotype of women." Women's rights organizations, public health groups, medical associations and others lobbied against his appointment. An editorial in The New York Times called him "Dr. Unqualified."

But after months of testimony and delay, he was confirmed by a vote of 68 to 24, garnering more support than many had expected. Some senators who had been hesitant to support him said he had convinced them of his integrity.

Dr. Koop himself said he had taken a principled approach to the nomination. As he and his wife, Elizabeth, had driven to Washington for the confirmation hearings, he recalled telling her, "If I ever have to say anything I don't believe or feel shouldn't be said, we'll go home."

An Only Child in Brooklyn

Charles Everett Koop was born on Oct. 14, 1916, in Brooklyn, and grew up in a three-story brick house in South Brooklyn surrounded by relatives; his paternal grandparents lived on the third floor, and his maternal grandparents as well as uncles, aunts and cousins lived on the same street. He was the only child of John Everett Koop, a banker and descendant of 17th-century Dutch settlers of New York, and the former Helen Apel.

Dr. Koop traced his interest in medicine to watching his family's doctors at work as a child. To develop the manual dexterity of a surgeon, he practiced tying knots and cutting pictures out of magazines with each hand. At 14 he sneaked into an operating theater at Columbia University's medical college, and he operated on rabbits, rats and stray cats in his basement after his mother had administered anesthesia. By his account, not one of the animals died.

Daniel E. Slotnik contributed reporting.