Sam Simon, who was one of the major creative forces behind “The Simpsons” and who left the show after its fourth season in a lucrative arrangement that allowed him to spend much of the rest of his life giving his money away, died on Sunday at his home in the Pacific Palisades area of Los Angeles. He was 59.

His death was confirmed by his agent, Andy Patman. Mr. Simon learned a few years ago that he had colon cancer.

The cartoonist Matt Groening, recruited by the producer James L. Brooks, invented the Simpson family for a series of short animated segments first seen on “The Tracey Ullman Show” in 1987. Mr. Groening named some of the characters after members of his own family, including Homer and Marge, the parents.

Although Mr. Groening is the person most closely associated with “The Simpsons,” Mr. Simon — who had published cartoons while he was a student at Stanford, worked on the cartoon show “Fat Albert and the Cosby Kids” and been a writer and producer for the sitcoms “Cheers” and “Taxi” — played a crucial role as “The Simpsons” evolved into a half-hour series. It became the longest-running sitcom in television history.