A man has stunned doctors by coughing up a 15-centimetre-wide blood clot from his lungs in the near-perfect shape of his right bronchial tree.

Key points: Doctors treating the 36-year-old man were "astonished" when he coughed up the clot

Doctors treating the 36-year-old man were "astonished" when he coughed up the clot The clot could have stayed intact due to a higher than usual concentration of a particular protein, which could have made the blood in his airways unusually rubbery

The clot could have stayed intact due to a higher than usual concentration of a particular protein, which could have made the blood in his airways unusually rubbery They said it was possible the man was able to cough it up because of its size, rather than despite it

The mysterious, cherry-red cast resembled a piece of coral, and an image of it has gone viral after appearing in The New England Journal of Medicine.

It came from a 36-year-old man with end-stage heart failure who spat out the medical anomaly in one piece during an extreme bout of coughing in hospital.

The doctors treating the patient were "astonished" after they unfurled the clot to find it had retained the shape of the lung pathway from which it came.

Despite the best efforts of intensive care staff at the University of California San Francisco Medical Centre, the man died a week later.

"We were astonished," pulmonary surgeon Georg Wieselthaler told The Atlantic.

"It's a curiosity you can't imagine — I mean, this is very, very, very rare."

The image of the clot has been widely shared because of how simultaneously grotesque and fascinating it is, with mixed reactions.

The patient, who had a history of heart problems, had been placed on oxygen and given blood thinners to help circulate blood and prevent clogging.

But blood eventually broke into his lungs and after days of coughing up smaller clots, the patient hawked up the famous one.

Doctors speculated the clot stayed intact due to a higher-than-usual concentration of a particular protein component of blood plasma, caused by the man's infection, which could have made the blood in his airways unusually rubbery.

They said it was possible the man was able to cough it up because of its size, rather than despite it, The Atlantic reported.

AAP