BEIJING — Under the best of circumstances, the Spring Festival in China is a logistical exercise of mind-blowing proportions: hundreds of millions of people traveling via planes, trains, buses and taxis to return to their hometowns to ring in the new lunar year with their families.

It’s the biggest human migration on the planet. And that’s without mentioning the bursting bags of gifts, clothing, food and liquor that travel with them.

But this year, authorities are dealing with a new and potentially deadly challenge: the spread of a mysterious, pneumonia-like virus that has killed four people. Experts initially thought that the virus, which began in an animal market, could not be spread between people but have now confirmed is being transmitted between humans.

“The outbreak is at a critical stage, and we estimate an increasing number of infections during the 40 days of Spring Festival travel rush,” said Zhong Nanshan, the leader of a group of experts at China’s National Health Commission and the respiratory disease specialist who discovered the severe acute respiratory syndrome, or SARS, during an outbreak in China in 2003.

China’s National Health Commission has confirmed 219 cases nationwide, almost all of the cases in the central city of Wuhan, where the outbreak was first detected on Dec. 31. But the diagnosis of the virus in other parts of the country, including among people who have not been to Wuhan, shows that the virus can be spread through human contact, Zhong told the state broadcaster, CCTV, Monday night.

“Guangdong has confirmed two cases that were definitely contagious [between human], because the patients have never been to Wuhan, but had been transmitted via infected family members,” said Zhong, referring to the southern province on the border with Hong Kong, where there have now been 14 confirmed cases.

Furthermore, 15 medical staff who treated the first patients in Wuhan have been diagnosed with the virus. A fourth infected person in Wuhan died Monday.

While Zhong and other experts expressed confidence that the virus could be contained and controlled, they said the mass movement of people around the country for the Spring Festival would complicate those efforts.

“If you live in Wuhan and have a fever, you should not leave the city right now,” Zhong said.

The news that the virus can be passed between people sparked panic buying of surgical masks across the country on Tuesday morning and led some people to cancel their travel plans.

The timing of the outbreak could hardly be worse. China’s Ministry of Transport expects an astonishing 3 billion trips to be taken in the 40 days that surround Lunar New Year’s Day, which falls on Saturday.

The Spring Festival, signaling the dawn of a new lunar year — the Year of the Rat, according to the Chinese zodiac — is the most important holiday on the Chinese calendar. Migrant workers of all stripes, from those who labor in factories to upwardly mobile professionals in big cities, return to their hometowns. It’s often the only time each year that families can gather together.

This flood of humanity even has a special name in Chinese: “Chunyun,” from the characters for spring and movement.

China’s multitudinous trains are packed literally to the rafters during this odyssey. People lie under the seats in sleeper cars and crouch in the hallways or in the vestibules between train cars. It’s not unheard of for people, even adults, to contort themselves into the overhead luggage racks. Those who aren’t so lucky might find themselves standing for a 12-hour journey home.

Despite the crush, the atmosphere on the trains is convivial and filled with the aroma of instant noodles. Almost everyone is excited to be going home and eager to share their snacks and their bottles of baijiu liquor (although some try not to drink a drop of anything to avoid having to go to the bathroom and potentially losing their few inches of real estate).

But as China becomes wealthier, and as more young professionals dread the idea of going home to be harangued about still being single, many people opt out of the spring movement by going abroad. Southeast Asia is a popular destination because it’s close, warm and cheap.

As a result, authorities in neighboring countries are also on high alert.

Cases of the mystery coronavirus have now been confirmed in Thailand and Japan, and on Monday, a woman was quarantined after thermal detectors at South Korea’s main airport, Incheon, singled her out. Health authorities in Taiwan, Hong Kong, Singapore and Vietnam are also monitoring suspected cases.

Three international airports in the United States — Los Angeles, San Francisco and New York’s John F. Kennedy — have started screening passengers on flights from China.

The virus appears to have started in a market that sold wild snakes, marmots, frogs and hedgehogs.

At the end of December, a cluster of pneumonia cases were reported in Wuhan, a city of 11 million people that straddles the Yangtze River in central China. The cases were traced to the west wing of the Huanan seafood market, where wild and exotic animals were sold for consumption.

State media described the market as “filthy and messy,” and it has been closed down and disinfected.

The market is less than a mile from the Hankou train station, one of Wuhan’s biggest transportation hubs. About 100,000 passengers pass through the station each day.

In the first 10 days of the Spring Festival travel period, there were more than 4 million trips through Wuhan by air, railway and highway, according to local media, and some 81 million journeys on the city’s public transportation network.

It wasn’t until Friday, after two deaths, that authorities in Wuhan started to check passengers’ body temperatures at airports and railway and bus stations. The local authorities have also launched a “patriotic health campaign,” disinfecting major bus, train and subway stations.

“I am quite worried,” said Zhou, a business owner in Wuhan who declined to provide her full name. She noted that stores had run out of masks. “What if it spreads very quickly? I hope it can be brought under control soon.”

Still, the mystery virus is spreading.

There have been five confirmed cases in the capital. The Beijing Health Commission said it has stocked enough antibiotics and asked 89 public hospitals to provide outpatient treatment for fever to cope with a possible “flu outbreak” during the holidays.

Five people who experienced respiratory problems after visiting Wuhan have been hospitalized in four cities across Zhejiang, outside Shanghai, and two people in Shanghai have been diagnosed with it.

In the south, 14 people in Guangdong province have been diagnosed with the virus. The severity of the infections was not disclosed.

Guangdong was the epicenter of the SARS epidemic in 2002 and 2003. More than 8,000 people were infected and 774 died. The virus spread to 37 countries before being contained.

China’s ruling Communist Party was widely condemned for trying to cover up the outbreak and stifle news reports about SARS, contributing to its spread. In the current outbreak, health authorities in Wuhan have been posting updates every night, although often after midnight.

Nevertheless, researchers at Imperial College London estimate that the real number of infections is much higher than Chinese authorities have disclosed. They said there were at least 1,723 cases by Jan. 12, before the latest spike, but perhaps as many as 4,500.

Neil M. Ferguson, an epidemiologist at Imperial College, said it was not clear whether these were new cases or just new confirmations. Chinese health authorities began conducting a new kind of test Thursday. “If they are all new cases, that would suggest that there is some human-to-human transmission,” he said.

Chinese authorities are stepping up efforts to contain the virus, telling citizens to wear masks and to try to reduce group activities as much as possible over the Spring Festival.

“Take precautions against transmitting contagious diseases such as the flu, even at get-togethers with family and friends,” the Beijing Health Commission said in a notice.

Those with symptoms such as fever and coughing are advised to wear face masks and avoid going to work or participating in group activities. “If you are obligated to attend, please stay at least one meter away from the next individual,” the commission said.

Health authorities in Shanghai and Zhejiang have allocated more staff in triage and fever clinics in hospitals and have set up new emergency procedures for dealing with suspected cases. 

Liu Yang and Wang Yuan contributed to this report.