Wayne Rogers, whose Trapper John McIntyre on “M.A.S.H.” was among the most beloved characters on one of the most popular shows of all time, an absurdist comedy set during the Korean War, died Dec. 31 in Los Angeles. He was 82.

The cause was complications from pneumonia, his publicist Rona Menashe said.

As army surgeon Trapper John, Mr. Rogers swapped wisecracks with partner in martinis and mischief Hawkeye Pierce, played by Alan Alda. They formed one of the most beloved duos in TV history, despite Mr. Rogers’s appearing in only the first three of the show’s 11 seasons on CBS.

The two skilled doctors, Hawkeye and Trapper, blew off steam between surgeries by pulling pranks, romancing nurses and tormenting their tent mate, Frank Burns (Larry Linville), with a seemingly endless supply of booze and one-liners at the ready.

In one classic moment, Trapper reaches out as though he’s checking for rain and says, “Hmm, feels like it’s going to martini,” as Hawkeye promptly passes him a drink.

Wayne Rogers starred as Trapper John McIntyre in the television series "M*A*S*H." He was among the most beloved characters on one of the most popular shows of all time. (AP)

And in another line that typified the show’s ethos, Trapper answers a question with: “How should I know? I dropped out of school to become a doctor.”

Mr. Rogers was on “M.A.S.H.” from 1972 to 1975, becoming one of many original cast members to leave the wildly popular show that lasted until 1983. He was initially considered for Alda’s character, but he preferred Trapper’s sunnier disposition to Hawkeye’s darkly acerbic personality.

The characters were essentially equals when the show began, but it increasingly focused on Alda, which was a factor in Mr. Rogers’s departure. (Mike Farrell became Alda’s later partner in comedy in the role of Capt. B.J. Hunnicut.)

Two other actors played Trapper in other incarnations. Elliott Gould was the same character in the “M.A.S.H.” feature film in 1970 that preceded the TV show, and Pernell Roberts played the title character in the 1980s spinoff drama “Trapper John, M.D.”

William Wayne McMillan Rogers III was born in Birmingham, Ala., on April 7, 1933. He graduated from Princeton University in 1954 and, following Navy service, studied acting at New York’s Neighborhood Playhouse workshop School of the Theatre.

He worked in theater and had parts on many short-lived TV shows early in his career, specializing in westerns such as “Law of the Plainsman” and “Stagecoach West.” He had a bit part in the 1967 film “Cool Hand Luke” with Paul Newman.

In the years after “M.A.S.H.,” he returned to TV regularly, including playing the starring role of a doctor in the CBS comedy “House Calls” from 1979 to 1982. He also had a recurring role in the early 1990s on “Murder, She Wrote” starring Angela Lansbury.

His first marriage, to actress Mitzi McWhorter, ended in divorce. Survivors include his wife, Amy Hirsh Rogers; two children from his first marriage; and four grandchildren.

Mr. Rogers moved beyond acting to achieve notable success later in life as a money manager and investor. In 1988 and 1990, he appeared as an expert witness before the House Judiciary Committee to speak in favor of maintaining the Glass-Steagall banking laws of the 1930s. In recent years, he was a regular panelist on the Fox News stock investment show “Cashin’ In.”

Reflecting on the disputes that led to his leaving “M.A.S.H,.” Mr. Rogers quipped, “If I had known that the show was going to run that long, I probably would have kept my mouth shut and stayed put.”