Majel Barrett, Gene Roddenberry and Leonard Nimoy on the set of The Cage.
Eugene Wesley Roddenberry was born in 1921. He had served as a combat pilot during the Second World War and a commercial airline pilot for several years afterwards. He resigned after at traumatic plane crash in the Syrian desert. He later joined the Los Angeles police force as a traffic cop and speechwriter for the Chief of Police. Whilst still working with the police, he began writing scripts for television, also serving as a technical advisor on Mr. District Attorney when it transferred to television from radio in 1951. Over the next decade he sold multiple scripts to shows such as Highway Patrol, The West Point Story and Have Gun - Will Travel. In 1956 he resigned from the police force to focus on his writing and in 1963 created his own show, The Lieutenant, about the US Marine Corps. The series was a popular success, but only aired for one season. Roddenberry was frustrated when his attempts to write more topical material, such as dealing with race relations in the service, were shot down by the studio.
Roddenberry had mostly written in the Western, crime and cop genres, but had become increasingly disenchanted with writing shows about contemporary problems, often looking at the darker side of life. Inspired by the ongoing Space Race between the United States and the Soviet Union, which promoted friendly competition in the field of science rather than direct military conflict, Roddenberry came up with an idea for a series about a starship (initially called the USS Yorktown, later changed to the Enterprise to be less US-centric). exploring new worlds and races in the distant future. The ship would be arranged along military lines and would be armed to defend itself, but its primary mission would be peaceful. Roddenberry sent a series of script ideas and a proposal to CBS, but they passed after an initial meeting which was only to see if the new idea was going to be competition for their in-development Irwin Allen series, Lost in Space. Desilu picked up the project and took it to NBC. Aware the science fiction was seen as a challenging genre (being expensive to produce but often ending up looking cheap), Roddenberry developed a pitch describing the show as "Wagon Train to the stars" (at one point even briefly considering that as the title), more about the people and their challenges than special effects or explosions.
NBC greenlit a pilot episode, selecting a script called The Cage. Roddenberry assembled a cast consisting of Jeffrey Hunter as Captain Christopher Pike, Majel Barrett as Number One, Leonard Nimoy as Mr. Spock (whom Roddenberry had worked with previously) and John Hoyt as Dr. Boyce. Filming began on 27 November 1964 and lasted for a fortnight.
The completed episode was presented to NBC in early 1965 under the title Star Trek. NBC were hesitant after test audiences reacted negatively to the slow-paced, cerebral episode and Roddenberry offered to create a second pilot. Unusually, NBC agreed (possibly due to a lack of promising new pilots for the 1965/66 season). When Jeffrey Hunter decided not to return as Captain Pike, Roddenberry created a new leading character, Captain James T. Kirk, and hired Canadian actor William Shatner to play him. In the event, Leonard Nimoy as Spock was the only character to return from the pilot (despite concerns over his "Satanic" appearance), although Majel Barrett did return in the new, recurring role of Nurse Christine Chapel. The second pilot, Where No Man Has Gone Before, which was a somewhat more action-focused story, went into production on 15 July 1965. NBC was particularly pleased with the low cost of the project, as it reused the sets from The Cage and indicated how the series could be produced on a modest budget despite its futuristic trappings. After a more positive reception to the pilot, they formally greenlit Star Trek for a first season of 16 episodes (later expanded to 29) in early 1966.