Epidemics have piggybacked their way on wars across the world for thousands of years. The Plague of Galen, which decimated Rome in 165 A.D., entered the empire with soldiers returning from the Near East. Infectious diseases, more than swords or guns, helped Pizarro conquer the Incas. In the early eighteen-seventies, a smallpox pandemic that accompanied the Franco-Prussian War killed more than half a million Europeans.

Smallpox vaccinators had police-like authority, and often operated without restraint. Illustration by RICHARD MCGUIRE

Smallpox claimed the lives of tens of thousands of French soldiers, yet the Prussians lost fewer than five hundred men. That was because Prussia vaccinated its entire Army against the virus, and France did not. There has never been a more dramatic demonstration of a vaccine’s power to alter the course of history. By the end of the decade, several European countries had passed laws mandating vaccination.

Those measures worked. In 1899, smallpox took just over a hundred lives in Germany, a nation of fifty million people. When epidemics broke out in the United States, as they did at about the same time, Surgeon General Walter Wyman seized on the European data, urging compulsory vaccination for all Americans. The disease had become so easy to prevent, he wrote, that “the smallpox patient of to-day is scarcely deserving of sympathy.” Throughout the United States, at the dawn of the Progressive era, dozens of laws and regulations were established to empower police officers, public-health officials, and even the armed forces to vaccinate at will, and, if necessary, at gunpoint.

As Michael Willrich, a historian at Brandeis, notes in his meticulously researched book “Pox: An American History” (Penguin; $27.95), those efforts helped bring an end to smallpox as a serious public-health threat in the United States. But the victory may have come at a cost, initiating what Willrich describes as “one of the most important civil liberties struggles of the twentieth century”: a ferocious clash between personal freedom and public health. The clash reverberates to this day, as a growing number of American parents refuse to inoculate their children against common childhood diseases. Universal vaccination may well be the greatest success story in medical history. But the movement also has a political history—and it’s far less reassuring.

Smallpox was among the most lethal viruses to afflict humanity, killing anywhere from twenty-five to sixty per cent of those it infected and leaving others scarred for life. The first symptoms were fever, malaise, body aches, and vomiting; soon victims suffered mouth sores and then the disease’s ghoulish signature, a savage rash. Within forty-eight hours, the lesions would spread across the body. The patient’s face would become badly swollen, the pain acute. A 1900 handbook of naval medicine describes the final stages: “The pustules break, matter oozes out, crusts form, first on the face and then over other parts of the body.”

Nobody is certain when or how smallpox first appeared. But the virus emerged in Europe sometime between the fifth and seventh centuries and was often endemic during the Middle Ages. By 1700, variolation—deliberate infection with smallpox—had been tried successfully as a preventive measure. It was dangerous, but far less so than the disease itself. Dried smallpox scabs were blown into the nose of an individual, who then contracted a mild form of the disease but was immune afterward. The Colonial preacher Cotton Mather, who had learned about variolation from his slave, attempted to introduce the new practice during a 1721 epidemic in Boston. Mather was denounced as an “inoculation minister,” and his house was firebombed. The actual vaccine—the world’s first—was invented by Edward Jenner, a British country doctor, at the end of the eighteenth century. After noting that milkmaids rarely got the disease, he theorized, correctly, that exposure to cowpox—a virus similar to smallpox but much less virulent—conferred resistance.

Today, Americans expect the federal government to respond to (and contain) any serious contagion. That wasn’t true in the late nineteenth century, the period of Willrich’s focus. The idea of calling for federal aid was unusual, and in the Deep South it was unthinkable. Then, in the mid-eighteen-nineties, after decades of relative quiescence, smallpox began to spread through the communities of Kentucky and other Southern states. Panic kept pace. As a member of the Kentucky Board of Health put it, “One case of small-pox in a tramp will create far more alarm in any community in Kentucky than a hundred cases of typhoid fever and a dozen deaths in the leading families.” Finding themselves defenseless against the virus, communities sought help from the United States Marine Hospital Service—the precursor to the U.S. Public Health Service.

The service dispatched doctors who rode from town to town like U.S. Marshals, brandishing masks and needles instead of badges and guns. They vaccinated the healthy and quarantined the sick. Once an epidemic was under way, those doctors were granted broad police-like powers, and they established the first foothold of federal authority in the South since the end of the Civil War and Reconstruction.

The logic used by the increasingly powerful federal government was straightforward: the good of the community had to outweigh objections raised by a minority. After all, what could be worse than a smallpox epidemic? Willrich offers an answer: curtailing basic civil liberties. As he points out in this eloquent, if not always persuasive, book, compulsory vaccination collided with fundamental medical and religious beliefs held by millions; it overran the rights of parents and, most painfully, contradicted strongly held, and particularly American, notions of personal liberty. For all those reasons, not to mention the fact that the vaccine itself occasionally killed people, the resistance was intense. Residents of many neighborhoods burned down their “pesthouses” (isolation hospitals for infectious patients), fled when vaccinators approached, fought with police, forged vaccination certificates, and often simply refused to deliver sick relatives to authorities.

Public-health officials stoked resentment by applying the laws without subtlety or restraint, Willrich points out, most of all to immigrants in the North and blacks in the South. (At the end of the nineteenth century, a black man in Kentucky was required to carry a certificate of vaccination—or display a scar on his arm—in order to move about freely. No such law applied to white men.) In February, 1901, an epidemic erupted in New York, and a vaccination squad moved en masse into the crowded Italian sections of the Upper East Side, where they thought the infection had originated. Willrich writes:

They followed the same method on each block. With policemen stationed on the roofs, at the front doors, and in the backyards, doctors and police entered the tenements and rapped on doors, rousing men, women, and children. Frightened and furious, the residents moved into the lighted areas, where doctors inspected their faces for pocks and their arms for the mark of vaccination. . . . Everyone lacking a good mark had to submit to vaccination.

Infected children were routinely taken from their mothers’ arms and sent to a pesthouse, where they often died—then, as now, there was no successful treatment. Many of those who were hauled away spoke no English; more often than not, they belonged to families that had fled despotic nations to live in what they thought was a democracy.

The anti-vaccine activists were aided by an inexplicable epidemiological anomaly. A new form of the virus appeared in the eighteen-nineties, one that wasn’t nearly as deadly as those which had come before; it seemed to kill just one per cent of the infected, and many doctors were not even sure the rashes were a sign of smallpox. Some thought it was a different disease entirely, and others wondered if the virus had become weak enough to ignore. The decline in virulence made opposition to vaccination much easier—especially given the uncertain risk posed by the vaccine itself.

These days, vaccines used in the United States are subject to years of clinical testing, several layers of regulatory approval, and the final judgment of the Food and Drug Administration. The oversight continues after vaccines are introduced. In the nineteen-nineties, federal health officials called for the live oral polio vaccine to be removed from the market, because it caused the disease in about ten children out of the millions who received it each year. A newer version, which has been used widely for more than a decade, eliminates even that small risk. But in 1900 the F.D.A. didn’t exist, and neither did any federal rules about how to make, test, or deliver vaccines.

By introducing laws that compelled vaccination without any safety regulations to go along with them, the government did nothing to reassure those who regarded compulsion with dread or indignation. The smallpox vaccine was produced in the least pleasant way imaginable: cows were infected with vaccinia virus, which is similar enough to smallpox to stimulate protective antibodies, and then virus-laden pus would be extracted from their sores. A brew of the material was then spread on a patch of skin that had been cut and then rubbed raw. The vaccine was effective and relatively safe. Yet no statistics were available to the public, and people often confused vaccination with the less precise technique of variolation, which had proved lethal to as many as one in fifty of those who received it. When smallpox was killing thirty per cent of its victims or more, the odds clearly favored vaccination. In a mild epidemic, where few people died, rejection of the vaccine made far more sense.