"The City on the Edge of Forever" is the twenty-eighth and penultimate episode of the first season of the American science fiction television series Star Trek. It was written by Harlan Ellison; contributors to and/or editors of the script included Steven W. Carabatsos, D. C. Fontana and Gene L. Coon. Gene Roddenberry made the final re-write. The episode was directed by Joseph Pevney and first aired on NBC on April 6, 1967.
In the episode, Doctor Leonard McCoy (DeForest Kelley) accidentally overdoses himself with a dangerous drug. He transports himself down to a mysterious planet while not in his right mind and is pursued by a rescue party led by Captain Kirk (William Shatner) and Spock (Leonard Nimoy), who soon come across the Guardian of Forever, a sentient time portal. McCoy travels back in time while impaired and changes history to such an extent that the Federation of Planets no longer exists. Kirk and Spock follow him to Depression-era New York City to attempt to fix the damage. While in the past, Kirk falls in love with Edith Keeler (Joan Collins), a soup kitchen operator who dreams of a future much like his own 23rd century. Spock eventually discovers that McCoy had changed the course of history by saving Keeler from dying in a traffic collision. Much to his personal grief, Kirk allows the crash to take place, restoring history.
The episode received widespread critical acclaim and is frequently considered among the best episodes of the Star Trek franchise. Elements such as the tragic ending were highlighted by several reviewers. It won several awards, including the Writers Guild of America Award for Best Episodic Drama on Television (Ellison, 1967) and the Hugo Award for Best Dramatic Presentation (Ellison and Pevney, 1968).
Plot As the USS Enterprise orbits a mysterious planet it is rocked by time distortions, causing Chief Medical Officer Leonard McCoy who is treating a near-death Lieutenant Sulu to accidentally inject himself with a huge dose of cordrazine, a dangerous drug. Driven into a mad frenzy, McCoy flees from the bridge and beams himself down to the planet. Captain James T. Kirk follows with a search party including first officer Mr. Spock, chief engineer Mr. Scott, and communications officer Lieutenant Uhura. On the planet's surface, they come across an ancient glowing ring which turns out to be a sentient object called the "Guardian of Forever", a portal capable of sending them to any time or place, and the cause of the distortions. The Guardian offers to send them back to Earth's past, and plays images of historical events which Spock records on his tricorder for research purposes. Meanwhile, the still-frenzied Dr. McCoy is found, subdued, and while the others are distracted by the Guardian's images, jumps through the portal. The landing party instantly loses contact with the Enterprise, and learn from the Guardian that McCoy has altered the past to such an extent that the Enterprise and the reality they knew no longer exists.
The Guardian says that it's possible to fix the damage, so Kirk requests that it replay the historical period it was showing when McCoy passed through. He and Spock attempt to jump through at a point in time just before McCoy's arrival and find themselves in New York City in 1930 during the Great Depression. They steal clothes from a fire escape to blend in, and while fleeing a policeman, hide in the basement of the 21st Street Mission. There they meet the soup kitchen's operator, Edith Keeler. She senses something odd about the intruders but nevertheless offers to pay them to clean up the basement and to find them a place to stay. Later, Spock attempts to discover how McCoy changed history by accessing the recordings on his tricorder, a task made difficult by the available technology of 1930, which Spock likens to "stone knives and bearskins". While Spock works on the engineering problem, Kirk pays their expenses by doing odd jobs at the mission and, learning of Keeler's dreams of a future much like his own era, falls in love with her.
Unknown to Kirk and Spock, the still-frenzied McCoy finally arrives and stumbles into the mission, where Keeler nurses him back to health. Spock completes his work and discovers that Keeler was supposed to die in a traffic collision but was somehow saved by the arrival of McCoy, creating an altered timeline in which she founded a pacifist movement on the eve of World War II. It grew powerful enough to cause the United States to delay its entrance into the war, and allow Nazi Germany time to develop the first atomic bomb and use it to win the war instead of the Allies and conquer the world. Kirk is shaken by this revelation and admits his love for Keeler, and Spock responds that she must die so as to prevent millions of deaths and restore their future.
While walking to a Clark Gable movie with Kirk the following evening, Keeler casually mentions McCoy's name. Shocked, Kirk tells Keeler to stay right there while he crosses the street back to the mission to inform Spock. McCoy emerges from the mission at the same time, and the trio reunite on the sidewalk. Observing this, Keeler begins to cross the street to join them and does not notice an oncoming truck. Kirk instinctively turns to save her, but a shout from Spock freezes him in his tracks and Kirk reluctantly grabs McCoy so he can't save her either. Keeler is struck and killed, and a stunned McCoy asks Kirk if he knows what he just did, but it is Spock who replies, "He knows, Doctor. He knows."
Kirk, Spock, and McCoy return through the Guardian and rejoin the landing party, where they find the Enterprise and their timeline is fully restored. Before they transport back to the ship, a grim-looking Kirk, ignoring questions about what happened and being told by the Guardian it can send them on more such journeys through time, replies simply, "Let's get the hell out of here."
Production
Writing The writing of this episode took over ten months, from the initial pitch by Harlan Ellison to the final re-write by Gene Roddenberry. Steven W. Carabatsos and D. C. Fontana, both story editors on the show, undertook re-writes of the teleplay, and changes have also been attributed to producer Gene L. Coon. The experience led to animosity between Ellison and Roddenberry for the rest of the latter's life, in particular over a dubious claim by Roddenberry that Ellison had the character Scotty dealing drugs in one version of the script. The episode went over budget by more than $50,000 and overran the production schedule. Mistakes were made in the set design with an instruction for "runes" misconstrued as a request for "ruins". With Matt Jefferies ill, Rolland Brooks designed the set and the Guardian of Forever, to the surprise of Jefferies on his return.
Initial pitch and outlines Harlan Ellison was one of the first writers recruited by Gene Roddenberry for Star Trek. Roddenberry was aiming to have the best science-fiction writers produce scripts for the show and had identified Ellison immediately. At the time, Ellison had been nominated for the 1965 Writers Guild of America Award for Outstanding Script for a Television Anthology with his script for the Outer Limits episode "Demon with a Glass Hand"; he went on to win. Rather than being assigned a pre-written premise, Ellison was allowed to develop his own and propose it in a 10-page outline. Ellison had read a biography of evangelist Aimee Semple McPherson, and thought that it would be an interesting idea to have Kirk travel back in time and fall in love with a similar woman of good intent, but someone who must die in order to preserve the future. Ellison considered that it would have a heartrending effect on Kirk.
In March 1966, Ellison pitched the idea to Roddenberry, who accepted it. A week later, he turned in his first script treatment. Producer Robert H. Justman later recalled that he thought it was brilliant. When writing it, Ellison did not have as many restrictions as some of the later writers; he was hired prior to the series bible being created. The first version introduced Lieutenant Richard Beckwith, who is sentenced to death after he kills a fellow crewman when he is threatened with the exposure of his involvement in the illegal drug trade. Ellison had included this element, since he expected the starship to be like any other military unit, having at least some unlawful people. Beckwith is then escorted to the surface of a nearby planet alongside Kirk, with Spock to carry out the execution by firing squad. Because of the planet's atmosphere, they have to wear environmental suits. On arriving, they find an ancient civilization and the remains of a city — this was Ellison's "city on the edge of forever". It is inhabited by several men, the Guardians of Forever, who protect an ancient time machine.
Kirk then asks to see the history of the United States on the machine, and as it reaches the Great Depression of the 1930s, Beckwith dives into the projection and vanishes. The guardians inform Kirk that history has been altered, and upon returning to the Enterprise, they discover that the vessel is now crewed by renegades. They fight their way back to the transporter room and return to the planet, where the Guardians allow Kirk and Spock to pursue Beckwith into the past. They are informed by the Guardians that Beckwith prevented the death of Edith Koestler, and as in the final version, Kirk falls in love with her; in this version, however, he does so knowing that she must die in the end. Emotionally, he cannot stop Beckwith from attempting to save KoestlerSpock has to do it. Roddenberry had asked for the ship specifically to be placed in danger, and so Ellison added the renegade element in response. Beckwith is captured but again escapes into the projection and ends up in an endless loop of an exploding Nova sunhe screams, and dies forever without end.
Roddenberry disagreed with some of Kirk's actions in the first draft, and he asked Ellison to rewrite the treatment without pay. The redraft took a further five weeks, after which Roddenberry gave more notes and Ellison took another two weeks to respond. When a version was received on May 13, Roddenberry and the executives at Desilu and NBC were all relievedthere had been concerns over the amount of time taken, as scripts were being pitched, written, and approved in the time taken for Ellison to revise his outline. This version dropped the environmental suits due to cost, and rewrote the information given to Kirk by the Guardians, making it more general and less Earth-specific. It also changed Edith Koestler's surname to Keeler. However, the majority of the plot points were unchanged.
Development of the teleplay