Writer Larry Gelbart, who developed the hit television show M*A*S*H that uncovered a rich wellspring of comedy and pathos in war, died of cancer on Friday at age 81.

He died in Los Angeles, his talent company, Creative Artists Agency told Reuters.

The Emmy-winning M*A*S*H lasted 11 seasons, becoming one of the most honored shows in U.S. television history before ending in 1983, with a final episode that set a record by attracting more than 106 million viewers.

Gelbart penned the 1972 pilot for M*A*S*H, a comedy set in the 1950s Korean War, which used that conflict as an allegory for the Vietnam War, in which the United States was embroiled during the early years of the series.

The show, based on a 1970 movie of the same name by director Robert Altman, was about wise-cracking doctors operating on the wounded just a few miles from the front lines, in what they called meatball surgery, because it called for quick action.

Producer and director Gene Reynolds called on Gelbart to write the pilot script for M*A*S*H, and he went on to write for other episodes. He also served as executive script consultant and shared an Emmy award with Reynolds when the series won for outstanding comedy in 1974.

Born the son of a barber, Gelbart began his career writing for radio as a teenager, writing for comedian Danny Thomas and later for the show Duffy's Tavern.

Later, while in the U.S. Army radio service, he wrote for personalities like Jack Paar and Bob Hope, before going on to work on 1950s television programs such as the comedy Caesar's Hour, writing alongside Mel Brooks and Carl Reiner.

Gelbart also co-wrote the book A Funny Thing Happened on the Way to the Forum, which became a Broadway musical in the 1960s, and the 1982 movie Tootsie starring Dustin Hoffman.

He was inducted last year into the Academy of Television Arts & Sciences Hall of Fame.

Gelbart is survived by his wife, Pat, children Adam and Becky, six grandchildren and two great-grandchildren.