BEIJING — As a trade war with the United States accelerated last January, Chinese leader Xi Jinping held a meeting with top Communist Party officials to warn about the surprise emergence of "black swan events" that could destabilize their 70-year rule.

Exactly one year later, an unexpected challenge did emerge — not from the halls of Washington but from market stalls in Wuhan.

While China battles a coronavirus epidemic with potentially far-reaching implications for global public health and the domestic economy, the Communist Party is scrambling to delicately manage the political risk as citizens fume over how officials bungled the initial response to the outbreak.

“This is the kind of ‘black swan’ moment when the fundamental legitimacy of the party is at stake,” said Kerry Brown, a professor at King’s College London who was first secretary in the British Embassy in Beijing during China’s last major epidemic, the 2002 outbreak of severe acute respiratory syndrome (SARS).

“It’s the moment when the party is supposed to show the merit of its highly controlled, highly coordinated system and its side of the social contract,” Brown said. Instead, “people seem to be getting more and more nervous.”

In recent days, China’s central leaders have appeared to take a bifurcated approach to diffuse discontent: allow citizens to vent about the failures of local officials in Wuhan — who initially covered up and ignored the coronavirus — while circling protective wagons around Xi, the president who has sought to cultivate an image as a beloved “People’s Leader.”

“Public perception will be shaped by the propaganda machinery, and that machinery is going into overdrive right now to protect Xi’s reputation,” said Steve Tsang, the director of the China Institute at SOAS University of London.

As the crisis snowballs unpredictably this week, party media organs have carefully hedged Xi’s political exposure.

After Xi met World Health Organization chief Tedros Adhanom Ghebreyesus on Tuesday, Chinese state media initially carried video showing him telling Tedros that he “personally directed” the response to the outbreak. But later, state outlets quoted Xi saying that his administration was “collectively directing” the response.

Xi has been shown once on television, on Lunar New Year’s Day, decisively ordering the formation of an epidemic response team. But he did not name himself the head of that commission.

Chinese officials may fear a political “catastrophe” if the virus were to continue spreading to major cities such as Beijing and Shanghai, said Victor Shih, an expert on the Chinese political economy at the University of California at San Diego.

“If Xi was fully confident of a victorious outcome against the disease, why not put himself in charge . . . and reap all of the glories?” Shih said.

Popular faith in Xi, who has pitched his strongman style as more effective than the decentralized administrations of his predecessors, could “evaporate” if the situation worsened dramatically, Shih added.

As nearly 55 million people adjust to an indefinite quarantine in central China and international airlines begin cutting flights to the country, frustrations are running high.

On Twitter, a service that is inaccessible inside China without the use of special software, Chinese users widely shared video of a Wuhan woman angrily wondering how the Communist Party could “build a moderately prosperous society if there were no people left.”

Others flocked to Douban, a Chinese equivalent of IMDB.com, where they left coded reviews about the HBO miniseries “Chernobyl.” Many linked the official ineptitude in present-day China and the Soviet Union’s final years and hinted that the Wuhan virus was something of a Chernobyl moment.

“There are so many similarities,” wrote the viewer “jianghai jiyusheng.” “Will there be a show in a few years about the Wuhan pneumonia?”

The Chernobyl nuclear meltdown in 1986 is widely seen as hastening the collapse of the Soviet Union a few years later.

By Tuesday, China’s authorities had seen enough. Censors did not take down the Chernobyl reviews outright but made the page invisible to anybody who wasn’t logged in with an account.

For all the public’s frustrations about their government, political observers say, many seem to be rallying around the top leadership. On Wednesday, a state-owned outlet called the Paper released a nationwide opinion survey showing Chinese broadly panning the recent performance of officials in the city of Wuhan and in wider Hubei province but retaining a high level of faith in their central leaders in Beijing.

Dali Yang, an expert on China’s politics and governance at the University of Chicago, said the government appeared to be content to let blame fall on lower officials as long as people did not question the basic legitimacy of the party or its bureaucratic culture. And authorities seemed even to be allowing a rare degree of dissent and debate about government transparency, he said.

“Blaming the locals is a time-honored strategy,” Yang said.

Indeed, China’s Internet this week has been rife with users freely mocking the party chief in Wuhan, the center of the new coronavirus, for tripping over his words about how protective masks can be produced. Others poked fun at a Hubei county that switched all its traffic lights to red in an effort to enforce the quarantine.

WeChat, the ubiquitous social media service, warned users that anyone who “spread rumors” about the virus could be jailed for up to seven years.

But after citizens broadly condemned Wuhan authorities for detaining and silencing doctors who reported the existence of the new virus four weeks ago, China’s highest court stepped in and reprimanded the local police for silencing whistleblowers.

“Rumors stop when information is public,” the usually conservative Supreme People’s Court said Tuesday on social media as it urged Wuhan officials to learn a “profound lesson.”

In a state television interview this week, Wuhan’s mayor, Zhou Xianwang, offered to resign, saying he was willing to take the fall if that would assuage popular anger.

After the crisis subsides, the Communist Party is likely to dismiss a number of local officials, depending on how bad things become, said Tsang, the SOAS professor.

“They will conclude the problem was not too much concentration of power, but rather not enough concentration of power” at the top, he said. “A few officials will be held accountable. And none of them will be Xi Jinping.”