When “Star Trek: Deep Space Nine” premiered in 1993, the science-fiction franchise whose legacy it extended was — like most of primetime television — episodic. The original “Star Trek” effectively hit the reset button at the beginning of each episode, sending Kirk, Spock, Bones and company on an all-new adventure. Its successor, “The Next Generation,” flirted with serialization, showing the ramifications of certain episodes in later ones, but ultimately adhered to the original’s episodic nature.

“Deep Space Nine,” about a remote outpost at the foot of a wormhole in space, was different. From the beginning, the series made clear that certain storylines would run throughout. (It is the only “Star Trek” to begin with a prophecy.) As it progressed over seven seasons, it transformed from a somewhat darker, more serialized version of previous “Trek” iterations to a serious-minded precursor to contemporary shows such as “Game of Thrones,” “The Walking Dead” and “Homeland.”

According to “DS9” showrunner Ira Steven Behr, the writers initially tried to make the show similar to other “Trek” series, but the results were not satisfying. Behr and David Zappone are co-directors of the documentary “What We Left Behind: Looking Back at ‘Star Trek: Deep Space Nine.’” The film, currently in post-production at Paramount, marks the series’ 25th anniversary and is slated for release in summer, 2018.

“We tried all these different types of things and none of them really seemed to work,” says Behr. “The standalone episodes just kind of bored the hell out of us for the most part. We were struggling. Then the episode that seemed to work at the end of season one had the double whammy of ‘Duet’ and ‘In the Hands of the Prophets.’ So by the end of season one, I felt that I had a handle on what the strength of this show was, which was building on this complicated backstory [creators] Michael [Piller] and Rick [Berman] had given the show.”

That particular style of storytelling did not sit well with everyone, though. Behr says when he tried to introduce interpersonal conflict during his time working on “TNG,” “Star Trek” creator Gene Roddenberry “handed me my head.”

“We all wanted conflict, but I just got into his crosshairs,” he says.

Roddenberry died in 1991. He had given his blessing to development of “DS9,” but held no sway over it.

“DS9” allowed “Trek” writers the chance to delve into that conflict like never before. Over the course of its run, the show tackled complex subject matter including the ethics of war, faith, cultural identity and the often subtle distinction between a freedom fighter and a terrorist in dark and surprising ways that the previous two series had not.

“I don’t think it was a coincidence that [‘DS9’s’ storytelling style] coincided with Ira Behr’s ascendancy,” says series star Alexander Siddig, who played Dr. Julian Bashir. “I think the great Michael Piller had an idea of where he wanted to go with the narrative, but it took the combination of Michel and Ira to really gel that. And Rick Berman was a great yes man. Any idea he thought was good, he would say, ‘Yes, try that.’ Rick broke the mold. He was the ultimate boss because he let Michael and Ira really try something pretty controversial at the time.”

Chase Masterson and Aron Eisenberg (left), Rick Berman and Ira Steven Behr (top right), Terry Farrell and Michael Dorn (bottom right)

SHAYAN ASGHARNIA for Variety

But being different didn’t exactly translate to ratings gold. “DS9” never matched the viewership success of “TNG,” though one could also attribute that to such factors as the changing television landscape. Still, the show was by no means the pop-culture force its predecessors had been.

“What evolved was kind of a third-child mentality of not being everyone’s cup of tea, but the people who liked it were passionate about it and really enjoyed the neurotic quality to our characters,” says René Auberjonois, who played security chief (or Constable) Odo. “Every single character on ‘Deep Space Nine’ had some deep psychic problem they had to work out. It was being developed at the time of the riots in Los Angeles and the burning of South Central. And also politically Bosnia and Yugoslavia. Everything was falling apart. There was a real darkness, and I think that deeply influenced the style of the show.”

As it turns out, that darkness and moral ambiguity was light years ahead of its time. Nowadays, audiences all but expect a series to present them with complex characters filled with flaws and doubts. One need look no further than the rise of anti-heroes including “Breaking Bad’s” Walter White or characters you love to hate or hate to love such as “Game of Thrones’” Jaime Lannister to see that the classic good guy-bad guy paradigm has shifted. Even “Star Trek: Discovery,” the recently launched CBS All Access installment of the franchise, has moved far beyond the style of the original series into a much darker, more complex serialized narrative style.

Nana Visitor played Major Kira on the series, but almost didn’t. She turned the part down initially on the advice of her manager who told her “you will kill your career if you do this job. Turn it down.”

A syndicated science-fiction television series was not, in the early ’90s, a prestige gig. But Berman called Visitor and pitched her on the vision for the show — and on Kira, a former member of a terrorist organization who had moved into a military position in a newly liberated society.

“By the end of the call, he had convinced me that I did want to be a part of it whether it impacted the rest of my career or not,” she says. “When I read the script, I thought, ‘That’s a man’s role. That’s not for me.’ Yet it was all I wanted to do. I hated every part that I had to play where I was chastising a husband or getting upset about the carpet. And I did a lot of those. Any time I could get my teeth into something, that was my flow state. That’s why I was an actor. Major Kira was like Disneyland for an actor.”

Fan reception to the character, and to the show as a whole, ran hot and cold. Previous female “Star Trek” characters had been helpmates — a switchboard operator (Lt. Uhura in the original series), a therapist (Counselor Troi in “Next Generation”), a healer (Dr. Crusher in “The Next Generation”). None had been a war veteran with emotional skeletons.

Marc Alaimo and Jeffrey Combs (left), Cirroc Lofton and Penny Johnson Jerald (right)

SHAYAN ASGHARNIA for Variety

“Some people in the ‘Star Trek’ world were like, ‘That’s not what a woman in “Star Trek” should be. That’s the wrong thing to be teaching,’” Visitor says. “But what I saw her as was a woman of appetite and gray area — lots of gray area. Very fallible, but growing and trying. And that’s all over television now.”

In a sense, the character was a precursor to Sonequa Martin-Green’s protagonist Michael Burnham on “Discovery.” The new streaming series revolves around Burnham, a young officer with a bright future who betrays her captain, sets off an interstellar war and is stripped of her rank.

The same streaming technology that makes it possible for “Discovery” to do away almost entirely with episodic storytelling has helped “Deep Space Nine” age well. Available on Netflix and CBS All Access, the series lends itself more to binge viewing than most other dramas of its era.

“What I think is happening now is that since it is on Netflix and streaming, people are watching it and seeing the whole story,” Auberjonois says. “People love to stream the original episodes and all the other versions, but ours is the one that is almost like a Russian novel. My sense of there is a growing base of an audience that really is getting it. Where people weren’t quite sure about it while it was happening episode by episode, now that they get to evaluate it as a whole piece, it’s being recognized in a way it wasn’t before.”

Thus the crew of “Deep Space Nine” will likely continue to boldly go for decades to come.