Last December he sent a message to fellow medics warning of a virus he thought looked like Sars - another deadly coronavirus.
But he was told by police to "stop making false comments" and was investigated for "spreading rumours".
News of his death was met with an intense outpouring of grief on Chinese social media site Weibo - but this quickly turned into anger.
There had already been accusations against the government of downplaying the severity of the virus - and initially trying to keep it secret.
Dr Li's death has fuelled this further and triggered a conversation about the lack of freedom of speech in China.
READ ALSO: CoronaVIRUS: 'Take us out of here' - Ghanaian student begs government
The country's anti-corruption body has now said it will open an investigation into "issues involving Dr Li".
The Chinese government has previously admitted "shortcomings and deficiencies" in its response to the virus, which has now killed 636 people and infected 31,161 in mainland China.
According to Chinese site Pear Video, Dr Li's wife is due to give birth in June.
Chinese social media has been flooded with anger - it is hard to recall an event in recent years that has triggered as much grief, rage and mistrust against the government.
The top two trending hashtags on the website were "Wuhan government owes Dr Li Wenliang an apology" and "We want freedom of speech".
Both hashtags were quickly censored. When the BBC searched Weibo on Friday, hundreds of thousands of comments had been wiped. Only a handful remain.
"This is not the death of a whistleblower. This is the death of a hero," said one comment on Weibo.
Many have now taken to posting under the hashtag "Can you manage, do you understand?" - a reference to the letter Dr Li was told to sign when he was accused of disturbing "social order".
READ ALSO: Coronavirus: Two suspected cases recorded at Korle Bu
These comments do not directly name him - but are telling of the mounting anger and distrust towards the government.
"Do not forget how you feel now. Do not forget this anger. We must not let this happen again," said one comment on Weibo.
"The truth will always be treated as a rumour. How long are you going to lie? What else do you have to hide?" another said.
"If you are angry with what you see, stand up," one said. "To the young people of this generation, the power of change is with you."
There was confusion over when exactly Dr Li had actually died.
He was initially declared dead at 21:30 on Thursday (13:30GMT) by state media outlets the Global Times, People's Daily and others.
Hours later the Global Times contradicted this report - saying he had been given a treatment known as ECMO, which keeps a person's heart pumping.
Journalists and doctors at the scene said government officials had intervened - and official media outlets had been told to change their reports to say the doctor was still being treated.
But early on Friday, reports said doctors could not save Dr Li and his time of death was 02:58 on Friday.
Dr Li, an ophthalmologist, posted his story on Weibo from a hospital bed a month after sending out his initial warning.
He had noticed seven cases of a virus that he thought looked like Sars - the virus that led to a global epidemic in 2003.
On 30 December he sent a message to fellow doctors in a chat group warning them to wear protective clothing to avoid infection.
Four days later he was summoned to the Public Security Bureau where he was told to sign a letter.
In the letter, he was accused of "making false comments" that had "severely disturbed the social order". Local authorities later apologised to Dr Li.
In his Weibo post he describes how on 10 January he started coughing, the next day he had a fever and two days later he was in hospital. He was diagnosed with the coronavirus on 30 January.
BBCLast modified on Friday, 07 February 2020