Earl Hamner Jr., the creator and narrator of CBS’ beloved, long-running family drama “The Waltons,” died Thursday in Los Angeles. He was 92 and had been diagnosed with cancer in June 2014, according to a Facebook post by his daughter.

She wrote: “I want to thank each and every one of you for your prayers, good wishes and kind thoughts – I can assure you that they sustained Dad and helped him to recover enough to proudly witness the final production of ‘Earl Hamner: Storyteller’, become the honored recipient of the Will Geer Theatricum Botanicum Humanitarian Award, and accept Media Heritage Founder’s Award. There is not a doubt in my mind that he would not have made it this far without you — and we had the good fortune to keep him in our lives a bit longer despite the odds against him. He never got enough of this great gift of life with which we have all been so deeply blessed — and he hung on as tightly as anyone could with insatiable passion and wonder. My heart is broken as I say, ‘Goodnight, Dad!’ ”

While Hamner became a writer and he was the eldest of eight children from a family in rural Virginia, not all of what appeared in “The Waltons” was entirely autobiographical. Hamner’s father, for example, worked in a coal mine, and his mother’s family came from Italy. Nevertheless his narration invested the series with a sense of earnest, heartfelt truth.

In 1971 he adapted his novel “The Homecoming: A Novel About Spencer’s Mountain” into the script for a TV movie called “The Homecoming: A Christmas Story” that served as the pilot for “The Waltons.” Richard Thomas played John-Boy Walton, and some of the other actors who would become familiar from “The Waltons” appeared in the movie, but Patricia Neal played Olivia Walton.

Hamner was Emmy nominated in 1972 and 1973 for writing “The Homecoming” and for an episode of “The Waltons.”

He also created the series “Apple’s Way” (1974-75) and “Boone” (1983-84), both of which had brief runs.

His film credits included adapting E.B. White’s novel “Charlotte’s Web” for the 1973 animated film of the same name, and he adapted the 1974 film “Where the Lilies Bloom” (1974).

Earl Henry Hamner Jr. was born in Schuyler, Virginia.

He got his start as a writer in television in the 1950s, penning episodes of “The Kate Smith Hour” and “The United States Steel Hour.”

Hamner wrote the novel upon which the Delmer Daves-directed 1963 film “Spencer’s Mountain” was based. The family drama starred Henry Fonda and Maureen O’Hara, and though the novel was set in Virginia during the Depression among a family much like the Waltons, this movie shifted the large clan to Wyoming.

As unlikely as it may sound, Hamner scripted a 1963 film called “Palm Springs Weekend,” starring Troy Donahue and Connie Stevens; the tagline was “It’s where the boys are and the girls are… that swingin’ vacation weekend when American youth descends on America’s swankiest playground!”

Hamner also penned eight episodes of “The Twilight Zone,” six episodes of “Gentle Ben” and four episodes of “Nanny and the Professor.”