Writer-producer David Dortort, who created “Bonanza,” died in his sleep Sept. 5 in Westwood, Calif. He was 93.

Oater “Bonanza,” which ran on NBC from 1959-73, got off to a rough start but was the No. 1 show on TV by 1961. Originally airing Saturday night, the Western with the recognizable theme song drew poor ratings and was targeted for cancellation, especially as it was taped in color and cost 25% more than other series of the time, but then Peacock moved the show to Sundays and the numbers soared. Second only to “Gunsmoke” in the number of years it aired, the show centered around patriarch Ben Cartwright, played by Lorne Greene, and his three sons.

Even after the show went off the air, there were several attempts to revive it, either as network movies or in syndication.

Dortort parlayed a longtime interest in the West into a series of successful shows. He started out at Gotham station WNYC and wrote for magazines on the side. After a four-year stint in the Army during World War II, Dortort’s novel “Burial of the Fruit” was published in 1947. And when its film rights were sold to Hecht-Lancaster Film Co., he was tapped to adapt it for the bigscreen.

A wrote several more screenplays including “Clash by Night” and “The Lusty Men.” He wrote several thrillers before returning to westerns

In 1957 Dortort penned “The Restless Gun” western series. “Gun” star John Payne liked his work enough to ask him to take over producing the series. The following year while penning “The Restless Gun,” during the day, Dortort wrote the pilot episode of “Bonanza” for NBC VP in charge of programming Alan Livingston at night.

“You always saw stories about family on comedies or on an anthology, but ‘Bonanza’ was the first series that was week-to-week about a family and the troubles it went through,” wrote Stephen Battaglio, a senior editor for TV Guide magazine, in 2009. “Another thing about ‘Bonanza’ that is interesting is that it is a period drama, but it attempted to confront contemporary social issues. That was very difficult to do then on television. Most shows that tried to do it failed because the sponsors didn’t like it, and the networks were nervous about getting letters.”

In the middle of “Bonanza’s” run, Dortort was prexy of the Producers Guild of America and served three consecutive terms as prez of the TV-radio branch of the Writers Guild while also teaching creative and screenwriting at UCLA.

During the show’s later years Dortort moved on to other shows such as “High Chaparral,” but after “Bonanza” was canceled he wrote and produced spinoffs and prequels such as “Bonanza: The Next Generation,” “Bonanza: The Return” and “Bonanza: Under Attack.” Other series he produced were “The Cowboys” in 1974 and mini “Chisholm” in 1979.

Dortort was nommed for three writing Emmys for “Bonanza,” “The Ox-Bow Incident” and “Climax.” Survivors include a son, a daughter, a granddaughter and a brother.

The funeral will take place at 1 p.m. Sunday at Mount Sinai Cemetery, 5950 Forest Lawn Dr. in Los Angeles. Donations may be made to the Writers Guild Foundation.