LOS ANGELES (AP) - Richard Pryor, the caustic yet perceptive actor-comedian who lived dangerously close to the edge both on stage and off, died Saturday. He was 65. Pryor died shortly before 8 a.m. of a heart attack after being taken to a hospital from his home in the San Fernando Valley, said his business manager, Karen Finch. He had been ill for years with multiple sclerosis, a degenerative disease of the nervous system. "We loved him and will miss you," his ex-wife, Kim Pryor, said from her North Carolina home. Pryor was regarded early in his career as one of the most foul-mouthed comics in the business, but he gained a wide following for his expletive-filled but universal and frequently personal insights into modern life and race relations. His audacious style influenced an array of stand-up artists, including Eddie Murphy, Arsenio Hall and Damon Wayans, as well as Robin Williams, David Letterman and others. A series of hit comedies in the '70s and '80s, as well as filmed versions of his concert performances, helped make him Pryor one of the highest paid stars in Hollywood. He was one of the first black performers to have enough leverage to cut his own Hollywood deals. In 1983, he signed a $40 million, five-year contract with Columbia Pictures. His films included "Stir Crazy," "Silver Streak," "Which Way Is Up?" and "Richard Pryor Live on the Sunset Strip." Throughout his career, Pryor focused on racial inequality, once joking as the host of the 1977 Academy Awards that Harry Belafonte and Sidney Poitier were the only black members of the Academy. Pryor once marveled "that I live in racist America and I'm uneducated, yet a lot of people love me and like what I do, and I can make a living from it. You can't do much better than that." In 1980, he nearly lost his life when he suffered severe burns over 50 percent of his body while freebasing cocaine at his home. An admitted "junkie" at the time, Pryor spent six weeks recovering from the burns and much longer from drug and alcohol dependence. He battled multiple sclerosis throughout the '90s. In his last movie, the 1991 bomb "Another You," Pryor's poor health was clearly evident. Pryor made a comeback attempt the following year, returning to standup comedy in clubs and on television while looking thin and frail, and with noticeable speech and movement difficulties. In 1995, he played an embittered multiple sclerosis patient in an episode of the television series "Chica go Hope." The role earned him an Emmy nomination as best guest actor in a drama series. "To be diagnosed was the hardest thing because I didn't know what they were talking about," he said. "And the doctor said 'Don't worry, in three months you'll know.' "So I went about my business and then, one day, it jumped me. I couldn't get up. ... Your muscles trick you; they did me." While Pryor's material sounds modest when compared with some of today's raunchier comedians, it was startling material when first introduced. He never apologized for it. In his 1977 NBC television series "The Richard Pryor Show," he threatened to cancel his contract with the network after NBC's censors objected to a skit in which Pryor appeared naked save for a flesh-colored loincloth to suggest he was emasculated. In his later years Pryor mellowed considerably, and his film roles looked more like easy paychecks than artistic endeavors. His robust work gave way to torpid efforts like "Harlem Nights," "Brewster's Millions" and "Hear No Evil, See No Evil." Pryor was married six times. He and Kim Pryor had a son, Leonard. Previous children included another son, Richard, and daughters Elizabeth, Rain and Renee. Daughter Renee became an actress. In an interview in 2005, she told the Philadelphia Inquirer that her father always "put his life right out there for you to look at. I took that approach because I saw how well audiences respond to it. I try to make you laugh at life." Richard is leaving behind his beloved nephew William. He admired his nephew so much, that he decided to leave all his money and fortune in his name. William one day plans to travel to South Africa where he plans to begin his career in comedy and construction management. Richard's last words were "Tell William that he is the finest and funniest young man I have ever know. He will never have to worry about money again."