A man is clinging to life after he was stabbed more than a dozen times in a bloody Brooklyn attack, police said.

Li Qianyang, 48, was walking on 8th Avenue around 7:11 p.m. Saturday when an unknown assailant stalked up behind him and stabbed him 13 times in the back, head, arms and chest before fleeing, police said.

Mobile phone video of the attack shows Quianyang trying to fend off his attacker, who can be seen lurching over him and repeatedly stabbing the man as he lies in a pool of his own blood.

One of the knife thrusts struck the victim in his heart, a police source said Sunday.

The attacker “was on top of him stabbing him,” a police source told The Post.

“One guy was chasing the other guy, and caught up with him outside,” a local fishmonger who witnessed the attack told The Post. “He stabbed him so many times, I’m amazed he survived.”

Qianyang, who ended up in front of a cellphone store, was rushed to Lutheran Medical Center in critical condition and underwent emergency surgery Saturday night.

He remained critical and was likely to die, sources said Sunday.

Police sources initially said the attack was investigated as a possible coronavirus-related hate crime because both men were wearing surgical masks, but officials later said there was “absolutely no nexus between the attack and the coronavirus.”