On June 3, 1969, NBC aired the final episode of Star Trek — a failure during its original run, the sci-fi series later spawned a franchise that has reportedly taken in more than $10 billion in revenue.

Its final third season episode, Turnabout Intruder, was based on a story by series creator Gene Roddenberry and hardly the series’ finest moment: Capt. James T. Kirk’s consciousness becomes trapped in the body of an old flame, bent on killing him and taking over his command of the starship Enterprise while inhabiting his body.

NBC had decided to pull the plug several months earlier and a letter writing campaign from Trekkies failed to win renewal for another season, as it had done a year earlier.

Star Trek was filmed by Lucille Ball’s Desilu Productions, which was sold to Gulf + Western in the late 1960s and renamed Paramount Television.

Before Turnabout Intruder aired on June 3, 1969, Paramount had started shopping reruns of the series’ 79 episodes for syndication, where it would unexpectedly become a phenomenal hit with late afternoon and early evening viewers.

By 1972, the Associated Press had branded Star Trek “the show that won’t die” as its reruns aired in more than 100 U.S. cities and 60 countries. More than 3,000 Trekkies attended the first fan convention in Manhattan in January 1972 and universities, including Emerson College, were offering seminars.

NBC took notice and brought back most of the original cast in a low-budget Saturday morning cartoon series for two seasons in 1973 and 1974.

A live-action, primetime series, Star Trek: Phase II, with William Shatner reprising his role as Capt. Kirk and much of the original cast returning was announced in the mid 1970s. But the success of Star Wars and Close Encounters of the Third Kind convinced Paramount to instead bring Star Trek to the big screen.

Beginning in 1979, Shatner starred in seven feature films as Kirk and Paramount went on to release a total of 13 movies.

Following the run of the original series in 1969, there have been six television spin-offs with plans for a few more underway on CBS All Access.

The feature films have taken in more than $1.7 billion at the box office alone, according to Box Office Mojo. However, Richard Arnold, a Star Trek archivist and consultant who worked for Roddenberry, said that Paramount has “admitted to about $10 billion” in total revenue from the franchise, which includes films, television series, books and home video releases.