Earle H. Hagen, Emmy-winning composer of some of the most familiar musical themes in television history, died of natural causes May 26 in Rancho Mirage, California. He was 88.

Hagen wrote the popular themes for “The Andy Griffith Show,” “The Dick Van Dyke Show,” “The Danny Thomas Show,” “I Spy,” “That Girl,” “The Mod Squad,” “Mickey Spillane’s Mike Hammer” and many more. He composed music for more than 3,000 individual shows during his TV career, which began in 1953 and lasted more than three decades.

He was also active in the film business, mostly as an arranger and orchestrator for 20th Century-Fox in the late ’40s and early ’50s. He received an Oscar nomination (shared with Lionel Newman) as musical director for the 1960 Marilyn Monroe film “Let’s Make Love.”

Born in Chicago, Hagen moved to L.A. as a child and began playing the trombone while in junior high school. By the age of 16, he was on the road playing with big bands that eventually included those of Benny Goodman and Tommy Dorsey.

It was while he was with Ray Noble’s band in 1939 that he wrote “Harlem Nocturne,” which became a jazz standard (recorded by Glenn Miller, Charlie Barnet and others) and became Stacy Keach’s “Mike Hammer” theme more than 40 years later.

Hagen gave up playing and became a full-time arranger during his wartime stint as part of the Army Air Forces’ Radio Production Unit in Santa Ana, Calif. After the war, he continued to arrange for popular singers including Frank Sinatra, Tony Martin, Dick Haymes and Frances Langford.

In 1946, Hagen accepted a contract offer from 20th Century-Fox music director Alfred Newman. There he contributed orchestrations and arrangements to dozens of films including such musicals as “With a Song in My Heart,” “Call Me Madam,” “Gentlemen Prefer Blondes” and “There’s No Business Like Show Business.”

Hagen left Fox in 1952 and formed a partnership with fellow arranger Herbert Spencer. Together, they scored “Make Room for Daddy” (later retitled “The Danny Thomas Show”), “The Ray Bolger Show” and other series; the partnership broke up in 1960.

Hagen became television’s leading composer of the 1960s and 1970s. His other series included “Gomer Pyle, USMC,” “Mayberry RFD,” “The Bill Dana Show,” “The Guns of Will Sonnett” and “Mary Hartman, Mary Hartman.” He contributed music to (but did not write the themes for) such other shows as “The Many Loves of Dobie Gillis,” “Eight Is Enough” and “The Dukes of Hazzard.”

Three of Hagen’s four Emmy nominations were for Hagen’s colorful, jazzy music for the Robert Culp-Bill Cosby adventure series “I Spy.” Hagen won for a third-season episode and also produced two albums of music from the series.

His final work for television was on the “Mike Hammer” series and the “Andy Griffith Show” reunion movie “Return to Mayberry” in 1986.

Hagen wrote three books: “Scoring for Films,” which for many years was the only available textbook on how to handle the technical aspects of writing music for movies, published in 1971; another text, “Advanced Techniques for Film Scoring,” in 1990; and an autobiography, “Memoirs of a Famous Composer (Nobody Ever Heard Of)” in 2002. After his retirement, Hagen taught the BMI Film Scoring Workshop for several years in the ’80s and ’90s.

Hagen’s wife of 59 years, the former Elouise Sidwell, died in 2002. Survivors include his second wife, the former Laura Roberts; two sons, three stepchildren and four grandchildren.

Donations may be made to the Mr. Holland’s Opus Foundation, http://www.mhopus.org.