After the outbreak of World War II, he was drafted into the Army in his sophomore year at the University of Richmond, which he had been attending on a scholarship. Trained to defuse land mines, he was sent to France after the Normandy invasion. There, a superior officer found out that he could type and assigned him to the Quartermaster Corps.

While stationed in Paris, Mr. Hamner, inspired by his discovery of Thomas Wolfe, William Faulkner and other American novelists, began writing fiction, including the first pages of what would become “Spencer’s Mountain,” about a man who dreams of building his wife a house on family land. The novel was published in 1961 with an admiring blurb from Harper Lee. A film version, with Henry Fonda and Maureen O’Hara, was later released.

Mr. Hamner earned a degree in broadcast communications from the University of Cincinnati in 1948 and began working at the Cincinnati radio station WLW, a job he soon quit to work on his first published novel, “Fifty Roads to Town,” about a revival preacher whose arrival in a small Appalachian town creates havoc. It was published in 1953, by which time Mr. Hamner had moved to New York and found work writing radio and television scripts for NBC.

In 1954, he married Jane Martin, an editor at Harper’s Bazaar, who survives him. In addition to his daughter, he is also survived by a son, Scott; a brother, Paul; and two sisters, Audrey Hamner and Nancy Jameson.

Mr. Hamner moved to California in 1962 and got his first break when “The Twilight Zone” accepted two of his story ideas. His eight scripts for the series included “The Hunt,” about a man who is dead but does not realize it until his hunting dog prevents him from wandering into hell, and “Stopover in a Quiet Town,” in which the main characters turn out to be pets on an alien planet.

“My mother-in-law found them downright weird,” Mr. Hamner said of his “Twilight Zone” scripts in a 2008 commencement address at the University of Cincinnati. “After she had watched four or five of my stories, she wrote my wife a note saying, ‘I do hope that Earl is not smoking any of that awful green stuff.’”