(Reuters) - Author Herman Wouk, whose World War Two experiences provided the foundation of his bestseller “The Caine Mutiny” and two epic novels about the war, died on Friday at the age of 103, his literary agent said.

FILE PHOTO: Author Herman Wouk sits at the desk in the office of his home in Palm Springs, California, U.S. November 6, 2012. Stephanie Diani/Simon & Schuster/Handout via REUTERS

Wouk, whose “War and Remembrance” and “The Winds of War” were turned into popular television miniseries in the 1980s, died in his sleep at his home in Palm Springs, California, Amy Rennert said.

He died 10 days before what would have been his 104th birthday, Rennert said.

Wouk was 100 years old when his final book “Sailor and Fiddler,” a memoir about his career as a writer and his Jewish faith, was published in December 2015.

He continued to write, even after stating that “Sailor and Fiddler” would be his last book, and was working on his next book up until a month ago, Rennert said.

Some critics dismissed Wouk as a middlebrow writer but his books - many of them bestsellers with a focus on moral dilemmas - showed a broad range.

In addition to his war tales, Wouk’s books included a comic novel (“Don’t Stop the Carnival”), a “Jewish-American princess” novel (“Marjorie Morningstar”), a novel about the publishing business (“Youngblood Hawke”) and theological musings as an Orthodox Jew (“This Is My God,” “The Will to Live On”).

“If they’re reading, then I’ve done what I set out to do,” Wouk said of his audience in a 2000 Washington Post interview. “... And so far, so good.”

Wouk was a show-business joke writer before the 1951 novel “The Caine Mutiny,” his third book, put him in the literary big time. It featured the paranoid, incompetent, ball-bearing-rattling Captain Queeg, who was later memorably portrayed in the movie version by Humphrey Bogart, and won Wouk a Pulitzer Prize for fiction.

“The Caine Mutiny” was on the New York Times bestseller list for more than two years, has sold millions of copies and is still in print.

Born in New York to Russian-Jewish immigrants, Wouk grew up in the New York borough of the Bronx and graduated at 19 from Columbia University. A stint as a joke writer for radio comedian Fred Allen was followed by wartime service in the South Pacific as an officer aboard destroyer-minesweepers.

That experience stripped away what Wouk once called “the hard shell of a New York wise guy” whose ambition had been to write Broadway farces. It also provided material for “The Caine Mutiny” and spurred him to explain the conflict in personal and historical terms.

He returned from the war determined to lead a different sort of life “because of the intensity of that experience,” he said. “It made me a writer.”

Wouk’s play “The Caine Mutiny Court-Martial” made its debut on Broadway in 1954, starring Henry Fonda, and has been revived twice.

Wouk felt “The Caine Mutiny” was merely an anecdote about World War Two rather than an exploration of the global conflict. Twenty years of research and writing led to “The Winds of War” in 1971 and its sequel, “War and Remembrance,” seven years later. Both books were more than 900 pages and were turned into successful television miniseries.

Wouk also worked with pop singer Jimmy Buffett to make a musical of “Don’t Stop the Carnival,” his 1965 novel about a New York public relations man who opens a Caribbean hotel. He was 97 when “The Lawgiver,” a satirical tale about making a movie based on the biblical figure Moses, was published.

Wouk divided his time between homes in Washington and Palm Springs, California. Wouk and wife Sarah, who worked as his agent, were married for 66 years until her 2011 death. They had three sons, one of whom died in childhood.

Wouk’s brother Victor, who died in 2005, was an early pioneer of alternative-fuel cars.