Nearly half the population of the Chinese city at the heart of the coronavirus outbreak left town before it was put on lockdown, officials have revealed.

Wuhan’s mayor, Zhou Xianwang, said on Sunday that some 5 million people left the city during the Lunar New Year travel rush, raising new fears of a global pandemic.

The flu-like illness has so far killed 81 people and infected more than 2,800.

The exodus from the city of 11 million took place during the 24 days between Dec. 30, when the first reports of infection emerged, and Thursday, when the city was effectively quarantined, Zhou said.

The travelers took off for Hong Kong, Thailand, Singapore and Japan, as well as other parts of China, the South China Morning Post reported.

Seventeen cities in China, encompassing more than 50 million people, have now been locked down as the virus has continued to spread.

Anger mounted on social media over officials’ response, with some accusing the government of withholding information in the early days of the outbreak.

Zhou admitted on state TV on Monday that the city’s handling of the crisis was “not good enough” and offered to resign.

But he also said his hands had been tied by rules requiring Beijing’s approval before releasing sensitive information about infectious diseases.

Meanwhile Monday, the Chinese Center for Disease Control and Prevention confirmed the virus originated at the Huanan Seafood Wholesales Market in Wuhan.

The now-shuttered market sold live animals including wolf pups, foxes, rats and peacocks.

“Thirty-one of the 33 positive samples were collected from the western zone of the market, where booths of wildlife trading concentrated,” the Chinese CDC said, according to China’s state-owned Xinhua news agency.

“The result suggests that the novel coronavirus outbreak is highly relevant to the trading of wild animals.”

Chinese authorities temporarily barred the trading of wild animals on Sunday.

On Monday, Mongolia closed its border with China, and Malaysia announced it would bar entry to visitors from Hubei province, of which Wuhan is the largest city.

President Trump also offered US help to control the growing crisis.

“We are in very close communication with China concerning the virus. Very few cases reported in USA, but strongly on watch. We have offered China and President Xi any help that is necessary,” Trump tweeted. “Our experts are extraordinary!”

Additional reporting by Natalie Musumeci and wire services