On September 8, 1966, NBC broadcast the first episode of Star Trek, created by Gene Roddenberry. The episode was "The Man Trap", about a creature that kills by draining salt and takes the shape of whoever it needs to. It was not the pilot. Two had been made, and the second, "Where No Man Has Gone Before", was broadcast later in the season.
The premise was sold with a phrase: Wagon Train to the stars. It got the show commissioned. Roddenberry's actual innovation was structural. By putting the show on a ship with a standing crew, he made it possible to write a Western one week, a war story the next and a murder mystery after that, with no cost for new sets and no need to explain why anyone was anywhere. That economics, not the space setting, is why the show could be made on its budget at all.
It was never a hit. NBC moved it, changed its time slot, threatened it twice, and a letter-writing campaign organised by fans got it a third season, which was put on at ten on a Friday night and killed it. Roddenberry had already stepped back by then. The show ended in June 1969 with 79 episodes.
What happened next did not have a precedent. Paramount sold the episodes into syndication, where they ran daily in local markets through the 1970s, and a show that had failed as a network series built an audience by being watched repeatedly. The first Star Trek convention was held in New York in January 1972, before the studio believed anything was happening; the first film followed in 1979.
The reason the syndication worked is that the episodes were about something. Roddenberry's rules for the writing were specific: the crew of the Enterprise was a multi-national, multi-racial outfit, the show would not fight the Soviet Union, and the stories had a built-in slot for an argument about right and wrong, usually by putting Kirk in a room with Spock and McCoy. Nichelle Nichols playing Uhura and being kept on the show by Roddenberry after she decided to leave is one of the better-documented details from that set, and it is why the character ended up in a NASA recruitment campaign twenty years later.