There are two ways to fight epidemics: the medieval and the modern.
The modern way is to surrender to the power of the pathogens: Acknowledge that they are unstoppable and to try to soften the blow with 20th-century inventions, including new vaccines, antibiotics, hospital ventilators and thermal cameras searching for people with fevers.
The medieval way, inherited from the era of the Black Death, is brutal: Close the borders, quarantine the ships, pen terrified citizens up inside their poisoned cities.
For the first time in more than a century, the world has chosen to confront a new and terrifying virus with the iron fist instead of the latex glove.
At least for a while, it worked, and it might still serve a purpose.
The Chinese leader, Xi Jinping, was able to seal off the city of Wuhan, where the Covid-19 outbreak began, because China is a place where a leader can ask himself, “What would Mao do?” and just do it. The bureaucracy will comply, right down to the neighborhood committees that bar anyone returning from Wuhan from entering their own homes, even if it means sleeping in the streets.
The White House, in defiance of recent American history, also opted to go medieval by aggressive measures like barring entry to non-Americans who were recently in China and advising Americans not to go to China or South Korea.
Over the years, states and cities have imposed local quarantines, but there have been no national restrictions on entry since 1892, according to Dr. Howard Markel, a medical historian and the author of “Quarantine!”
In that year, President Benjamin Harrison ordered that all ships from Hamburg be kept offshore for 20 days because officials in that city, one of the world’s biggest ports, had lied about its cholera epidemic.
It apparently succeeded. The United States had cholera outbreaks in 1832, 1849, 1870 and 1910, but not in 1892.
Many public health figures consider shutting a nation’s doors to be an archaic tactic, and nearly impossible in the jet age.
But for Mr. Trump, such a move is natural. He was elected on a Build-the-Wall platform and in 2014, when a few heroic American medical workers got infected fighting Ebola in West Africa, he advocated leaving them there to die. (They were flown back, and survived.)
Also, this virus’s speed and apparent lethality gave the experienced doctors in the White House Coronavirus Task Force reason to be nervous. It is spreading between nations very quickly. And, while data is still sketchy, some measurements indicate that its fatality rate might be close to that of the 1918 Spanish flu.
As a result, they endorsed dropping the portcullis and shutting off air links to China.
They even created quarantine stations on military bases, the equivalent of Venice’s island lazarettos, where, in the time of the doges, the infected awaited their fate outside the city.
This has led to much consternation among other public health experts, who argue that travel restrictions can cause more panic, misery and death than they prevent. Crowds may besiege hospitals, supercharging the infection rate. Closed borders can cut off vital medications like insulin. Factory and shop closings mean lost wages, hardships and possibly recession.
Also, quarantines feed racism and stigma.
Officially, the World Health Organization opposes travel and trade restrictions. It reiterated that even as it declared the epidemic a global emergency on Jan. 30.
But it now admits that they helped. The head of the W.H.O. team that visited China said this week that China “took one of the most ancient strategies and rolled out one of the most ambitious, agile and aggressive disease-containment efforts in history.”
The W.H.O.’s epidemic-modeling teams concluded that travel restrictions had slowed the spread of the virus outside China by two to three weeks.
For the United States, the delay was probably far greater. Air-traffic data shows that flights from China to the United States dropped much more than they did to Europe.
As of this writing, a single case not connected to any known transmission has turned up in California, but there are no indications of large outbreaks like those in Italy and Iran.
Harsh measures horrify civil libertarians, but they often save lives, especially when they are imposed in the early days.
The best-known modern example is Cuba’s AIDS epidemic. In the 1980s, Cuba and the United States were both hit hard by the AIDS epidemic. In Cuba, the virus first infected thousands of soldiers, doctors and nurses who had served in Africa.
The Castro regime’s response — roundly condemned by other countries — was to make H.I.V. tests mandatory, and to force everyone infected into quarantine camps. The camps were not hellholes: they had bungalows, gardens, theater troupes, medical care, more food than people outside often had, and less homophobia than gay men often faced in macho rural Cuba. But no one could leave, except for brief family visits with an escort whose main job was to make sure that no sex took place.
Meanwhile, the United States took a pro-legal-rights approach. Even offering an H.I.V. test was made illegal without a separate counseling session, which scared many away from testing. Although gay bathhouses were epicenters of transmission, there were long divisive fights over closing them.
After triple therapy was developed in the mid-1990s, most Cuban camps closed.
But the difference in lives saved by choosing brutality over freedom was stark: Cuba’s H.I.V. infection rate was for decades about one-sixth that of the American one. New York City and Cuba have roughly the same population. In the epidemic’s first 30 years, fewer than 2,500 Cubans died of AIDS. Over 78,000 New Yorkers — mostly gay men — did.
As the virus creeps closer, stark choices will arise. The United States cannot shut out the whole world. Even if all air travel were stopped, the virus could reach Latin America or Canada and enter over our land borders.
With luck, the extra time that China bought us by falling on its viral grenade will help produce a treatment or a vaccine. The threat will subside and reporters like me will be accused of alarmism.
Top American health officials now say “it is not a matter of if but when” the virus begins to spread here. But the American experience will not echo the Chinese one.
China has had imperial rule since 221 B.C. The United States, born of rebellion, prizes individual rights.
There will be no national lockdown. No threats to have anyone “forever nailed to history’s pillar of shame,” as one of Mr. Xi’s underlings warned those who hid cases of infection.
But local control — and the political factionalism that is endemic to democracy — can carry grave risks in the face of a crisis, Dr. Markel noted.
In 1918 and 1919, as the Spanish influenza swept across the country in waves, various cities reacted in their own ways.
Cities like St. Louis that reacted quickly — canceling parades and ballgames, shutting schools, transit systems and government offices, ordering the sick to stay home — ultimately had fewer deaths.
In cities like Philadelphia and Pittsburgh, which were paralyzed by political feuds or pressure from local businesses to avoid shutdowns, many more ultimately died.
To overcome the divisiveness that would imperil a cohesive national response, Dr. Markel said, “you need leadership from the top — and there has to be trust. In an epidemic, the idea that ‘everyone is entitled to their own facts’ is really dangerous.”
The Times is committed to publishing a diversity of letters to the editor. We’d like to hear what you think about this or any of our articles. Here are some tips. And here’s our email: letters@nytimes.com.
Follow The New York Times Opinion section on Facebook, Twitter (@NYTopinion) and Instagram.