The cause was cancer, his son Andrew said.

Over nearly half a century, Mr. Stuart played a leading role in the production of more than 50 films, most of them documentaries that reflected his fascination with history and politics. Among them are "The Rise and Fall of the Third Reich" (1968), based on William L. Shirer's best-selling book; and "Four Days in November" (1964), about the assassination of President John F. Kennedy, which was nominated for an Oscar.

It was "The Making of the President, 1960," based on Theodore H. White's best-selling book tracing Kennedy's rise to the White House, that earned Mr. Stuart his first Emmy, in 1964. Jack Gould, writing in The New York Times, called it "a superlative television documentary."

Six years later, Mr. Stuart won another Emmy for "The Making of the President, 1968," also based on Mr. White's work, which recounted the tumult of the Vietnam War years leading to President Lyndon B. Johnson's decision not to seek re-election and Richard M. Nixon's defeat of Hubert Humphrey.

Those documentaries bracketed the 1967 Emmy Mr. Stuart received as director of "China: The Roots of Madness," a compact account of the Communist revolution led by Mao Zedong that traced its ideological origins in the 19th century.

In 1981 he produced the television drama "Bill," starring Mickey Rooney, about a man in his 60s who goes out into the world after decades in a mental institution. It won Golden Globe and Peabody Awards.

While documentaries brought Mr. Stuart most of his acclaim, it was to please one person that he decided to direct "Willy Wonka & the Chocolate Factory." His daughter, Madeline, had read Roald Dahl's book "Charlie and the Chocolate Factory" over and over by the time she was 10, and asked him to make a movie based on it. The film, released in 1971, tells the tale of young Charlie Bucket as he and four other children visit a bizarre chocolate factory run by Willy Wonka, memorably played by Gene Wilder. (Another movie based on the same book, "Charlie and the Chocolate Factory," directed by Tim Burton and starring Johnny Depp as Willy, was released in 2005.)

Madeline Stuart had a cameo role in the original movie.

Stuart Solomon (his son did not know when or why he changed his name to Mel Stuart) was born in Manhattan on Sept. 2, 1928, to Edgar and Cecille Solomon. His father, who owned a hat store, was an avid student of history and "imparted that to my dad," Andrew Stuart said.

Beside his son Andrew and his daughter, Mr. Stuart is survived by another son, Peter, and two grandchildren. His wife, the former Roberta Silberman, died last year.

Mr. Stuart graduated from New York University in 1949 and went to work for an advertising agency. Through that job he became an assistant to the avant-garde filmmaker Mary Ellen Bute, which led to his hiring as a researcher for Walter Cronkite's series "The 20th Century."

In 1959, the producer David L. Wolper asked Mr. Stuart to join his newly formed production company. After 17 years with Mr. Wolper, he became an independent producer.

"He was known as an eccentric and at times irascible character," Andrew Stuart said.

When "Willy Wonka" was released, critics were far from enthusiastic. Daily Variety called it "cynical and sadistic."

Thirty years later, Mr. Stuart told The Los Angeles Times that its popularity lies in its unflinching honesty. "I'm not talking down to children and giving them squirrels with funny faces and all that stuff," he said.