D.C. Fontana, who helped craft the lore of the 1960s television series “Star Trek” and developed one of its signature characters, Spock, as the show’s first female writer, died on Tuesday at a hospital in Burbank, Calif. She was 80.

Her husband and only immediate survivor, Dennis Skotak, said the cause was cancer.

Ms. Fontana was part of the “Star Trek" universe from its early days, working alongside the show’s creator, Gene Roddenberry , as a story editor and writer.

The original series, which had its premiere in 1966, introduced audiences to Captain Kirk, the United Federation of Planets and the Starship Enterprise. But Ms. Fontana was best known among fans for her work on Spock, the half-human, half-Vulcan Starfleet officer portrayed by Leonard Nimoy.

Spock was torn between the emotionality of his human side and a Vulcan’s zealous commitment to logic. That narrative tension powered much of the series and several of the feature films that followed.