The news was terrifying to colonists in Massachusetts: Smallpox had made it to Boston and was spreading rapidly. The first victims, passengers on a ship from the Caribbean, were shut up in a house identified only by a red flag that read “God have mercy on this house.” Meanwhile, hundreds of residents of the bustling colonial town had started to flee for their lives, terrified of what might happen if they exposed themselves to the frequently deadly disease.

They had reason to fear. The virus was extremely contagious, spreading like wildfire in large epidemics. Smallpox patients experienced fever, fatigue and a crusty rash that could leave disfiguring scars. In up to 30 percent of cases, it killed.

MPI/Getty Images
A Boston advertisement for a cargo of about 250 enslaved people recently arrived from Africa circa 1700, particularly stressing that the enslaved people are free of smallpox, having been quarantined on their ship.

But the smallpox epidemic of 1721 was different than any that came before it. As sickness swept through the city, killing hundreds in a time before modern medical treatment or a robust understanding of infectious disease, an enslaved man known only as Onesimus suggested a potential way to keep people from getting sick. Intrigued by Onesimus’ idea, a brave doctor and an outspoken minister undertook a bold experiment to try to stop smallpox in its tracks.

Smallpox was one of the era’s deadliest afflictions. “Few diseases at this time were as universal or fatal,” notes historian Susan Pryor. The colonists saw its effects not just among their own countrymen, but among the Native Americans to whom they introduced the disease. Smallpox destroyed Native communities that, with no immunity, were unable to fight off the virus.

Smallpox also entered the colonies on slave ships, transmitted by enslaved people who, in packed and unsanitary quarters, passed the disease along to one another and, eventually, to colonists at their destinations. One of those destinations was Massachusetts, which was a center of the early slave trade. The first enslaved people had arrived in Massachusetts in 1638, and by 1700, about 1,000 enslaved people lived in the colony, most in Boston.

In 1706, an enslaved West African man was purchased for the prominent Puritan minister Cotton Mather by his congregation. Mather gave him the name Onesimus, after an enslaved man in the Bible whose name meant “useful.” Mather, who had been a powerful figure in the Salem Witch Trials, believed that owners of enslaved people had a duty to convert enslaved people to Christianity and educate them. But like other white men of his era, he also looked down on what he called the “Devilish rites” of Africans and worried that enslaved people might openly rebel.

Mather didn’t trust Onesimus: He wrote about having to watch him carefully due to what he thought was “thievish” behavior, and recorded in his diary that he was “wicked” and “useless.” But in 1716, Onesimus told him something he did believe: That he knew how to prevent smallpox.

Onesimus, who “is a pretty intelligent fellow,” Mather wrote, told him he had had smallpox—and then hadn’t. Onesimus said that he “had undergone an operation, which had given him something of the smallpox and would forever preserve him from it...and whoever had the courage to use it was forever free of the fear of contagion.”

The operation Onesimus referred to consisted of rubbing pus from an infected person into an open wound on the arm. This was done in a controlled manner and under the supervision of a physician so the symptoms would be milder but still confer immunity. Once the infected material was introduced into the body, the person who underwent the procedure was inoculated against smallpox. It wasn’t a vaccination, which involves exposure to a less dangerous virus to provoke immunity, but it did activate the recipient’s immune response and protected against the disease most of the time.

Mather was fascinated. He verified Onesimus’ story with that of other enslaved people, and learned that the practice had been used in Turkey and China. He became an evangelist for inoculation—also known as variolation—and spread the word throughout Massachusetts and elsewhere in the hopes it would help prevent smallpox.

Cotton Mather
Corbis/Getty Images
Cotton Mather.

But Mather hadn’t bargained on how unpopular the idea would be. The same prejudices that caused him to distrust his servant made other white colonists reluctant to undergo a medical procedure developed by or for Black people. Mather “was vilified,” historian Ted Widmer told WGBH. “A local newspaper, called The New England Courant, ridiculed him. An explosive device was thrown through his windows with an angry note. There was an ugly racial element to the anger.” Religion also contributed: Other preachers argued that it was against God’s will to expose his creatures to dangerous diseases.

But in 1721, Mather and Zabdiel Boylston, the only physician in Boston who supported the technique, got their chance to test the power of inoculation. That year, a smallpox epidemic spread from a ship to the population of Boston, sickening about half of the city’s residents. Boylston sprang into action, inoculating his son and his enslaved workers against the disease. Then, he began inoculating other Bostonians. Of the 242 people he inoculated, only six died—one in 40, as opposed to one in seven deaths among the population of Boston who didn’t undergo the procedure.

The smallpox epidemic wiped out 844 people in Boston, over 14 percent of the population. But it had yielded hope for future epidemics. It also helped set the stage for vaccination. In 1796, Edward Jenner developed an effective vaccine that used cowpox to provoke smallpox immunity. It worked. Eventually, smallpox vaccination became mandatory in Massachusetts.

Did Onesimus live to see the success of the technique he introduced to Mather? It isn’t clear. Nothing is known of his later life other than that he partiall purchased his freedom. To do so, writes historian Steven J. Niven, he gave Mather money to purchase another enslaved person. What is clear is that the knowledge he passed on saved hundreds of lives—and led to the eventual eradication of smallpox.

In 1980, the World Health Organization declared smallpox entirely eradicated due to the spread of immunization worldwide. It remains the only infectious disease to have been entirely wiped out.