“No one is safe until everyone is,” the United Nations has cautioned about the covid-19 pandemic, a warning now amplified by coronavirus variations able to dodge vaccines that are, in any case, too few and too concentrated in wealthy parts of the world. That a global pandemic requires a global response is a lesson firmly rooted in medical history. It took over 200 years of international efforts to eradicate smallpox. The first attempt showed that a vaccine was necessary, but not sufficient. Ending the global transmission of a deadly disease also requires international travel that is safe and global relations based on terms of equality, two conditions that remain difficult to ensure.

History’s first global health initiative was Spain’s Royal Philanthropic Vaccine Expedition, which sailed around the world from 1803 to 1813 delivering smallpox vaccinations. The venture astonished people at the time. Such maritime circumnavigations were associated with death, not health, and doing anything good on a planetary scale was unprecedented.

Indeed, the effort was mostly driven by Spain’s imperial and economic concerns, not philanthropy or humanitarianism.

Beginning with the Canary Islands in the 1490s, Spanish overseas imperialism had blended military conquest, enslavement and commercial monopoly. Spain’s monarchs next used those tactics to blast into the Caribbean, then Central and South America. Spain also pioneered the biggest of land grabs — around the world — by sponsoring Ferdinand Magellan’s westward voyage that ended up making history’s first circumnavigation, 1519-1522, and inaugurating Spain’s colonization of the Philippines.

Imperialism brought Spain profits and prestige. It became the model for all European empires, even though the human cost of these invasions was appalling. Some American Indian populations may have diminished as much as 90 percent, in part from contagions new to them. The worst malady was smallpox, a 3,000-year old Eurasian disease that could kill up to 30 percent of the infected and disfigure and blind survivors. European invaders globalized this ancient horror, carrying it into West Africa, the Americas and the Pacific.

But in the early 1700s, Europeans and American colonists learned, from Ottoman Turks and West Africans, a miraculous remedy: inoculation, in which material from smallpox pustules was inserted into the uninfected, triggering a milder form of the disease — and lifetime immunity. In the 1790s, English physician Edward Jenner made inoculation even safer by using pus from sores caused by cowpox, a related though milder disease. Cowpox vaccine (“vacca” is Latin for “cow”) would be what the Spanish carried around the world, scant years after Jenner had reported his experiments in print.

The creation of a vaccine coincided with another historic first, the increasing safety of long-distance ship travel. Only by the 1800s could “around the world” signal life, not death. Magellan’s circumnavigation had barely succeeded: Only one of his five ships returned, carrying (at most) 18 of the 270 to 280 original crew members. Subsequent expeditions tried to recircle the planet, with similar fatalities. Not until the late-18th century would circumnavigators’ survival rates improve.

For the first time, a circumnavigation to bring health seemed credible, if barely. Indeed, the Spanish plan was ambitious: to perform vaccinations, organize local medical boards and seed stocks of vaccine in multiple places, thousands of miles apart. From Spain, the team stopped in the Canaries, Puerto Rico and Venezuela. Deputy surgeon José Salvany then covered territories in present-day Colombia, Ecuador, Peru, Bolivia and Chilean Patagonia, while commanding surgeon Francisco Xavier de Balmis went to Cuba and Mexico. Balmis next sailed to the Philippines (aboard the Fernando de Magallanes, no less), continuing to China, St. Helena and back to Spain.

By some measures, the mission triumphed. Hundreds of thousands of people were vaccinated, nearly 200,000 in Peru alone. These people, mostly children, were directly protected and their immunity helped prevent epidemics. Success across oceans and continents made a global health effort seem achievable, with some striking international cooperation. In China, for example, the Spanish vaccinators worked with British officials despite their two nations being at war — their navies fought in the Battle of Trafalgar in the same month, October 1805, that Balmis arrived in Guangzhou.

Such results, however, required some dubious practices. Preserving the vaccine outside a warm body was still difficult. So, the expedition took on, as wards of the state, 22 Spanish foundlings, abandoned boys raised in charitable institutions, 3- to 9-years old. On departure, they were vaccinated in sequence as symptoms prompted transfer of the vaccine, arm-to-arm, to keep it alive. Twenty-six new boys were added in Mexico, and others subsequently, for a total of 62. The Spanish foundlings were placed for adoption in Mexico City and the parents of recruits were compensated. But there were casualties: four boys (6 percent) died at sea.

And why trust these newest Spanish invaders, anyway? Indians in Peru distrusted Salvany so much they called him the anti-Christ. “They doubt everything,” he complained, “which the White Man proposes.”

They had good reason: Vaccination was intended to maintain Spanish rule over them. King Carlos IV’s philanthropy was perhaps sincere, atoning for the sins of his ancestors. But his ministers and colonial officials backed the expedition to protect the empire’s labor supply, particularly among Indians. The expedition thus resembled the forced inoculations or vaccinations of enslaved people that were also taking place, medical interventions, without consent, to protect plantation economies.

Smallpox would continue to ravage populations without access to vaccination (it killed an estimated 300 million people in the 20th century) and eradicating it required a more equal global society. Only after the dismantling of European empires in the 20th century could international medical authorities inspire confidence in vaccination and medical tracing. The World Health Organization began its historic anti-smallpox campaign in 1967 and declared victory in 1980. New technologies, including freeze-dried vaccine (no more orphans) coincided with the democratization of world travel via commercial aircraft, allowing medical professionals to coordinate their global defeat of smallpox.

The year 2021 isn’t like 1803, and it isn’t like 1980. Yet again, we have a new vaccine. But if empires have faded, imperialism’s effects haven’t, as highly unequal access to vaccination demonstrates. Meanwhile, Brexit and “America First” show the erosion of global solidarity. And worldwide airline travel is now both solution and problem. It distributes vaccines, but it’s also spreading novel diseases in the first place, including HIV/AIDS and covid-19. It’s easier than ever to travel around the world, but also to bring death back home. That threat won’t end with vaccination. Instead, identifying outbreaks early and monitoring travelers from affected regions is critical — until everyone cooperates in doing that, no one is safe.