HANGZHOU, China — A Chinese doctor who was silenced by police for trying to share news about the new coronavirus long before Chinese health authorities disclosed its full threat died after coming down with the illness, a hospital statement said, triggering an outpouring of anger online toward the ruling Communist Party.

Li Wenliang, a 34-year-old ophthalmologist at Wuhan Central Hospital, became a national hero and symbol of the Chinese government’s systemic failings last month. Li had tried to warn his medical school classmates Dec. 30 about the existence of a contagious new virus that resembled the deadly severe acute respiratory syndrome (SARS).

Word began to spread in China thanks to Li, but his posts were censored, and he was detained Jan. 1 for “rumor-mongering.”

The full outlines of his story, which came to light in recent weeks as the Wuhan outbreak exploded into an international emergency, set off a swell of outrage in China, where citizens have long chafed at the government’s penchant for relentlessly snuffing out any speech deemed threatening to social stability.

Many, including China’s judicial authorities in a rare rebuke of the police, have wondered whether the epidemic would have unfolded differently had Li not been silenced at the critical juncture around Jan. 1.

Guan Hanfeng, an orthopedist at Wuhan’s Tongji Hospital, and Luo Yu, a technology industry executive who was one of the deceased doctor’s university classmates, broke the news of Li’s death late Thursday.

“The Wuhan government owes Dr. Li Wenliang an apology,” Luo wrote in a widely circulated post on the Weibo social media site as tributes flowed in. Twitter hashtags such as #DoctorLiPassedAway attracted millions of views and comments.

But for hours there were conflicting reports about Li’s fate. A social media post from Li’s hospital said he was in “critical condition and we are trying our best to rescue him.”

Later, Wuhan Central Hospital posted a message confirming that Li died after he became “infected during the course of his work battling the pneumonia epidemic due to the spread of the new coronavirus.”

The doctor’s death sparked grief and outrage on Chinese social media as people expressed fury toward the authorities for their efforts to cover up Li’s initial warning of the coronavirus danger, portraying him as a martyr and demanding answers from the government.

“We demand freedom of speech” became a trending hashtag on Weibo, China’s version of Twitter, early Friday, echoing the sentiments of the 1989 Tiananmen Square uprising. By dawn, that hashtag had been scrubbed by censors.

A World Health Organization official, Michael Ryan, described Li as being on the “front line” of battling the novel coronavirus, which has claimed more than 560 lives.

On Dec. 31, Chinese authorities informed the World Health Organization’s China office of the mysterious pneumonia cases in Wuhan. But it would be weeks before Chinese health officials acknowledged the seriousness of the outbreak and began to take unprecedented measures to lock down tens of millions of people in Wuhan and surrounding areas.

Ryan, executive director of the World Health Organization’s health emergencies program, told reporters in Geneva on Thursday: “We are deeply saddened by the passing of Dr. Li Wenliang. We all need to celebrate work that he did.”

Li was released from detention Jan. 3 after signing a police document admitting that he committed an illegal act by making “untrue statements” on social media and promising that he would “earnestly reflect” on his mistakes.

After they detained Li, Wuhan police appeared on Chinese state television to warn the public about the dangers of spreading rumors. In a coordinated state media push that day, they urged Internet users across the country to not believe online rumors and help build a “clear and bright cyberspace.”

Days after he was released the first week of January, Li returned to work receiving patients who were beginning to flood into Wuhan’s hospitals.

He began coughing Jan. 10, he later recalled. This past Saturday, three weeks after he checked himself into his hospital, he told his social media followers that he had finally been tested: He was indeed infected by the coronavirus.

As he spent his final days in Wuhan Central’s intensive-care unit, Li began publicly sharing how he sought to warn friends about the new virus, his ordeal with the police and his fight with the illness.

He revealed that he lived with a pregnant wife and young child, and had quickly quarantined himself as soon as he suspected he was infected. His mother and father were now hospitalized for fever, he said without disclosing whether they — or his wife and child — contracted the coronavirus.

But he maintained an upbeat presence on social media and assured his followers that he kept his medical license and hoped to leave the hospital as soon as possible.

“I’ve seen the support and encouragement so many people online have given me,” he wrote. “It makes my feel a little more relaxed in my heart.”

As word of Li’s death trickled out Thursday night, his followers left messages on his Weibo account pleading in vain for him to post one last update. Hours after his death was confirmed, Chinese users began repeating a literary verse to express their gratitude for a man they felt their country did not deserve.

“He who holds the firewood for the masses,” they wrote, “is the one who freezes to death in wind and snow.”