C. Everett Koop, the former surgeon general of the United States who started the government’s public discussion of AIDS during the Reagan administration, died Feb. 25 at his home in Hanover, N.H. He was 96.

A spokeswoman for the C. Everett Koop Institute at Dartmouth confirmed his death but did not disclose the cause.

Dr. Koop was the most recognized surgeon general of the 20th century. He almost always appeared in the epauleted and ribboned blue or white uniform denoting his leadership of the commissioned corps of the U.S. Public Health Service. With his mustacheless beard, deep voice and grim expression, he looked like a Civil War admiral or, as some cartoonists suggested, a refugee from a Gilbert and Sullivan musical.

The theatrical appearance, however, masked a fierce self-confidence, an unyielding commitment to professional excellence and a willingness to challenge the expectations of his patrons.

A 64-year-old retired pediatric surgeon at the time Ronald Reagan nominated him in 1981, Dr. Koop had no formal public-health training. His chief credential was that he was a socially conservative, Christian physician who had written a popular treatise against abortion. His confirmation took eight months. Few people expected him to talk about homosexuality, anal intercourse, condoms and intravenous drug use when almost nobody else in the Reagan administration would even utter the word “AIDS.”

Dr. Koop, however, believed information was the most useful weapon against HIV at a time when there was little treatment for the infection and widespread fear that it might soon threaten the general population. In May 1988, he mailed a seven-page brochure, “Understanding AIDS,” to all 107 million households in the country.

“He was a guy who surprised everybody,” said Anthony S. Fauci, director of the National Institute of Allergy and Infectious Diseases, who was Dr. Koop’s chief tutor in AIDS matters and became a close friend. “People expected one thing, and they not only got another thing, they got someone who was amazingly effective.”

“You couldn’t go anywhere where he wasn’t recognized. Even the tollbooth guy on the [Boston] Callahan Tunnel — everybody recognized that beard,” said former Food and Drug Administration commissioner David Kessler, who worked closely with Dr. Koop on the campaign against tobacco, among other issues. “He really was America’s doctor.”

Kessler recalled Dr. Koop’s refreshing lack of ideology, which sometimes perplexed those inside the Beltway.

“He knew very little about Washington when he arrived, and he developed political instincts that were very attuned to what the country expected,” Kessler said. “It’s really proof that you can’t really label anyone.”

Among AIDS activists Dr. Koop became an unlikely hero, although some came to think that his sexually explicit talk tended to further stigmatize gay men.

“Most of us thought that a huge part of how the crisis grew exponentially was that those in power chose to ignore it for as long as they could,” recalled Peter Staley, a founding member of the AIDS Coalition to Unleash Power. “He was the only person in that administration who spoke the truth when it came to AIDS.”

Dr. Koop was also a tireless campaigner against tobacco. As surgeon general, he released a report in 1982 that attributed 30 percent of all cancer deaths to smoking. He wrote that nicotine was as addictive as heroin, warned against the hazards of secondhand smoke and updated the warning labels on cigarette packs.

Michael C. Fiore, founder of the University of Wisconsin Center for Tobacco Research and Intervention, once said Dr. Koop’s reports on smoking “totally changed the landscape” of tobacco control.

He was among the last survivors of a small generation of American doctors forced by World War II into highly responsible roles at very young ages. After the war, many became academic physicians and researchers who helped fuel the explosion of medical therapeutics in the second half of the 20th century. In Dr. Koop’s case, the new frontier was pediatric surgery, a specialty that barely existed when he entered it. He became one of the half-dozen leading practitioners in the world.

A Coney Island epiphany

Charles Everett Koop, an only child, was born in Brooklyn on Oct. 14, 1916. His father, who did not finish high school, was an officer at a bank. His mother occasionally assisted in at-home surgical operations in the neighborhood by administering anesthesia — a task the surgeon often farmed out to a responsible bystander. His paternal grandparents lived with his family, and his maternal grandparents and many cousins lived nearby.

Dr. Koop claimed he first expressed a desire to become a surgeon when he was 6 years old.

His maternal grandfather used to take him to Coney Island. In a conversation in 2007, Dr. Koop said this was not only for the entertainment, but also to teach the boy how to spot hustlers and grifters. He recalled an unusual sideshow — a display of premature infants in incubators, attended by nurses from the New York Foundling Hospital.

“I often thought how much of my life I spent with my hands in one of those incubators,” he said. “Every time I would go and work on a baby, in the beginning, I’d have these reminiscences of Coney Island, where I first saw them.”

Dr. Koop attended Dartmouth College on a football scholarship but had to give up the sport after suffering an eye injury. He majored in zoology and graduated in 1937. That fall he entered Cornell University’s Medical College, in New York City.

He graduated in 1941 and did an internship in Philadelphia before starting surgical training at the University of Pennsylvania. By the time his residency began, just months after the Pearl Harbor attack, much of the surgical staff had entered military service.

That left a large amount of work to the surgical residents, and Dr. Koop proved to be an unusually skilled and energetic one. Within six weeks of starting on July 1, 1942, he was removing gallbladders and doing unassisted partial resections of stomachs — his supervisors notified but not present.

Although he was married, and by 1944 a father as well, he spent nearly all his time at the hospital. He estimated that he did as many operations in four years as residents do in “seven or eight years — there was nobody around to do the surgery.”

He also did much of the work on a project assigned to Penn by the War Department to study the use of liquid gelatin as a substitute for blood plasma for the treatment of shock in battlefield casualties.

“I took to that investigational work very readily,” recalled Dr. Koop, who ultimately wrote a thesis and earned a doctor of science degree for the research. “I was my own guinea pig. I would operate after having lost 1,000 ccs of blood and taken 500 ccs of gelatin, and then recorded all my vital signs. I have probably taken my body weight in gelatin, intravenously.”

He and another Penn doctor were scheduled to run a clinical trial of the plasma substitute in China. Five days before they were to leave, however, the Army told them it wanted military physicians to run the study. Dr. Koop and his colleague unpacked their bags. The airplane carrying the Army researchers disappeared over the Atlantic.

Early surgical achievements

After the war, the surgeon in chief at the Hospital of the University of Pennsylvania suggested that Dr. Koop take a job as the head of surgery at Children’s Hospital of Philadelphia (CHOP). When he assumed the position in January 1946, he was not yet 30.

At the time, general surgeons, or specialty surgeons such as urologists, operated on infants and children without specific training in how their anatomy and physiology differed from those of adults. The only pediatric surgery program in the country was in Boston. Operations on newborns were rare and mortality was high.

“I went to the Children’s Hospital to do pediatric surgery. I spent the first 18 months doing pediatric anesthesia — trying to get rid of the barriers that were making it impossible to get living babies out of the operating room,” Dr. Koop said in 2007.

Often there wasn’t even appropriate equipment. Before an operation on a newborn, he and the anesthesiologist would make a tube for the windpipe by cutting the smallest urine catheter down to size, filing the edges smooth with an emery board, and then inserting a wire and boiling it to get the desired curvature.

Dr. Koop insisted that his team provide all the postoperative care to surgical patients, much to the consternation of pediatricians at CHOP old enough to be his father. In 1956, he created what was reputedly the first neonatal surgical intensive care unit in the country.

Over four decades of practice, he improved the technique for hernia repairs (and did 17,000 of them). He developed a correction for a congenital defect known as esophageal atresia and a method for draining fluid from the brain into the abdomen for infants with hydrocephalus. He separated several sets of conjoined twins, including, in 1977, a pair joined at the heart in which only one baby could be saved. He trained dozens of pediatric surgeons who went on to head departments elsewhere.

After retiring as surgeon general in 1989, Dr. Koop lectured, wrote an autobiography and in the 1990s, with other investors, established a Web site, Dr­Koop.com, that provided medical information. The enterprise proved an embarrassment, however, when it turned out some of the information was paid advertising. It no longer exists.

President Bill Clinton awarded Dr. Koop the Presidential Medal of Freedom in 1995. In recent years, he was a scholar at an institute that bears his name at Dartmouth Medical School. Its purpose is “promoting the health and well-being of all people.”

Dr. Koop’s wife of 67 years, the former Elizabeth Flanagan, died in 2007. She had worked as a secretary to support the couple while her husband was in medical school.

Survivors include his wife, the former Cora Hogue, whom he married in 2010; three children from his first marriage, Allen Koop, the Rev. Norman Koop, a Presbyterian minister, and Elizabeth Thompson; and eight grandchildren.

A son from his first marriage, David Koop, was killed in a mountaineering accident in New Hampshire in 1968 when he was a 20-year-old student at Dartmouth. Dr. Koop and his first wife later wrote a book, “Sometimes Mountains Move,” about their experience of grieving in the hope it might help other parents who had lost children.

Brady Dennis contributed to this report.