SGranitz / WireImage 1 / 6
SGranitz / WireImage 1 / 6

Richard Pryor defied doctors' advice not to smoke in his final days and continued to puff away even on his deathbed, according to his close pal Gene Wilder.

RELATED: Kim Kardashian's tightest looks

The comic, who struggled with substance abuse throughout his career, suffered from multiple sclerosis in his later life and was also diagnosed with heart problems. Medics urged him to quit his nicotine habit in a bid to prolong his life, but Wilder reveals his stubborn friend and "Silver Streak" co-star didn't listen, reports

RELATED: The royal couple's favorite sports

Speaking during a special career overview at New York's 92Y last week, Wilder recalled, "He had a heart [issue], and he wanted to smoke. The doctor said, 'I am telling you, if you smoke, you will die. Don't smoke.'"

Added Wilder: "When I went to see him, he had cigarettes and a lighter, and he couldn't walk without stumbling. He couldn't really do much, except he knew how to put the cigarette in his mouth. I didn't know what I could say to him to stop him from smoking cigarettes."

RELATED: Kim Kardashian's curvy maternity style

Pryor died from a cardiac arrest in 2005.