Premier Li Keqiang, the prime minister of the Chinese government, flew on Monday into Wuhan, the epicenter of the outbreak, to show support for medical workers and to pledge needed medical supplies — only to be mocked online for leading workers in an encouraging cheer.

Mr. Li’s visit, which featured prominently in state media, came as Wuhan’s mayor, Zhou Xianwang, acknowledged that the local authorities had moved too slowly in the first days of the crisis.

In an interview with CCTV, the main state television network, the mayor said that information about the coronavirus had not been shared with the public in a timely manner, and that he and the city’s Communist Party secretary, Ma Guoqiang, were prepared to resign to “appease public indignation.”

“Our names will live in infamy for shutting the door” of the city, Mr. Zhou said. “But we believe that as long as it helps to control the disease, helps keep people’s lives safe, Comrade Ma Guoqiang and I will shoulder any responsibility,” Mr. Zhou said.