In closing off Wuhan, a city of more than 11 million people, China is deploying a centuries-old public health tactic to prevent the spread of infectious disease — this time, a mysterious respiratory infection caused by a coronavirus. Experts said the stunning scale of the shutdown, isolating a major urban transit hub larger than New York City, was without precedent. “It’s an unbelievable undertaking,” said Dr. Howard Markel, a professor of the history of medicine at the University of Michigan, adding that he had never heard of so many people being cordoned off as a disease-prevention measure.

Still, “people are going to get out,” he said. “It’s going to be leaky.” By limiting the movements of millions of people in an attempt to protect public health, China is engaging in a balancing act with a long and complicated history fraught with social, political and ethical concerns. James G. Hodge Jr., director of the Center for Public Health Law and Policy at Arizona State University, said the shutdown would almost certainly lead to human rights violations and would be patently unconstitutional in the United States.

“It could very easily backfire,” he said, adding that the restrictions could prevent healthy people from fleeing the city, perhaps exposing them to greater risk of infection. “In general, this is risky business.” To combat the spread of the virus, which first appeared at the end of December and has killed at least 17 people and sickened more than 500, the Chinese government said it would cancel planes and trains leaving Wuhan beginning Thursday, and suspend buses, subways and ferries within it.