Extreme measures during outbreaks have been imposed elsewhere before. During the Ebola epidemic in West Africa in 2014, Sierra Leone ordered everyone in the nation to stay home for three days as the authorities went door-to-door checking for new cases, retrieving dead bodies and trying to stop the disease from spreading further. In Monrovia, the capital of Liberia, a sprawling neighborhood with tens of thousands of people was put under strict quarantine by the government and guarded by police officers in riot gear, setting off violent clashes with penned-in residents.

During the 2003 SARS outbreak, anyone in China who displayed symptoms of the disease was hospitalized, and students were examined daily. In Singapore, people suspected of having SARS were confined to their homes and monitored with webcams and electronic bracelets.

Still, medical experts were startled by the scale of the shutdown in Wuhan, which has more people than the entire country of Sierra Leone. Dr. Tom Inglesby, director of the Johns Hopkins Center for Health Security, said that a city the size of Wuhan has “tens of thousands of connections with the outside world that are coming and going all the time, bringing food and medicine.”

”The complexity and downside cost of that will be potentially very high,” Dr. Inglesby said.

Roughly 30,000 people fly out of Wuhan on an average day, according to air traffic data analyzed by researchers at Northeastern University in Boston. Many more leave using ground transportation like trains and cars. The city is the hub of industry and commerce in central China, home to the region’s biggest airport and deep-water port and sometimes known as the Chicago of China. It is popular among tourists for its colonial architecture, spicy noodles and proximity to the Yangtze River.