[[caption-width-right:320:''"'Let me help.' A hundred years or so from now, I believe, a famous novelist will write a classic using that theme. He'll recommend those three words even over 'I love you.'"'']]

Series: Series/{{Star Trek The Original Series}}\\
Episode: Season 1, Episode 28\\
Title: The City On the Edge of Forever\\
Previous: The Alternative Factor\\
Next: Operation: Annihilate!\\
Recapper: {{Tropers/Deckard}}]

->''"As I'm watching the episodes for reference just before drawing each strip, I take notes on ridiculous stuff that I can make fun of in the comic. Things that pull me out of the story and make me think, "That makes no sense. I can make a gag about this bit." For most episodes I have anywhere between 10 lines and half a page of notes. When this episode ended, I had written nothing."''
-->-- '''David Morgan-Mar''', creator of ''Webcomic/PlanetOfHats''

In the penultimate episode of the first season (based on a treatment by Creator/HarlanEllison), the crew of the ''Enterprise'' finds itself exploring a [[NegativeSpaceWedgie "temporal disturbance"]] near an unknown planet. Electromagnetic interference causes the ship's computer to explode, injuring Sulu. [=McCoy=] runs to prepare an injection of super-adrenaline for him, but turbulence causes him to [[IntoxicationEnsues accidentally inject himself]] and become BrainwashedAndCrazy. [=McCoy=] escapes the bridge and beams down to the planet.

Following him, the landing party discovers [[RuinsForRuinsSake a city of ancient ruins]] that appears to be uninhabited and empty except for a mysterious glowing green archway, which appears to be sentient and exhibits [[PsychicPowers strange telepathic abilities]], acts as a viewscreen displaying various scenes from Earth history. The archway, which calls itself the Guardian of Forever, explains that it is a [[PortalToThePast portal to any place and period in history.]] It also easily steals Spock's CulturalPosturing crown.

The conversation with the Guardian is interrupted when [=McCoy=] runs through the archway and disappears. Moments later, Uhura reports a loss of contact with the ''Enterprise'', and the crew realize that [=McCoy=] has somehow altered the course of history since entering the portal. In order to return to their ship and restore the original timeline, they must follow him and prevent him from doing whatever he did. Steeling themselves to find the correct moment in history, Kirk and Spock jump through the portal and arrive in UsefulNotes/NewYorkCity during TheGreatDepression, where the pair must disguise themselves while they search for [=McCoy=]. Unfortunately, their Starfleet uniforms (and Spock's Vulcan ears) [[HighlyConspicuousUniform attract unwanted attention]]. When the pair attempt to steal clothes, they are chased by the police and end up hiding in the basement of a homeless shelter run by the kind, [[WideEyedIdealist idealistic]] [[BrainyBrunette and smart]] social worker Edith Keeler (Creator/JoanCollins). Keeler offers to take in Kirk and Spock and find them work, although she is slightly suspicious of their [[MildlyMilitary military demeanour.]]

While Kirk and Spock do menial jobs, Spock is able to [[BambooTechnology construct a rudimentary computer]] using electronic parts he has assembled, which he uses to analyze his tricorder's recording of the historical scenes shown in the archway. Kirk and Edith begin to fall in love. Spock discovers a terrible truth: Soon after he entered the portal and arrived on Earth, [=McCoy=] saved Keeler from dying in an auto accident. Since she did not die as intended, she later became [[SoapboxSadie a peace activist]] and successfully convinced UsefulNotes/FranklinDRoosevelt to keep America from entering UsefulNotes/WorldWarII until too late, [[GodwinsLawOfTimeTravel allowing the Nazis to win]] and preventing Starfleet from ever existing. Kirk and Spock realize that [[SadisticChoice in order to prevent this from happening, Edith Keeler must die.]]

Meanwhile, [=McCoy=] has been running loose in the city, still affected by the drugs. After an altercation with a homeless man who [[RecklessGunUsage steals his phaser and shoots himself with it]], he is found and taken in by Keeler, who believes he is merely drunk. As he recovers from the drug's effect, he befriends her, unbeknownst to Kirk and Spock.

The following night, Kirk takes Edith on a date to the movies -- the night of her accident. An offhand comment by Edith reveals to Kirk that she knows [=McCoy=]. When Kirk and Spock run into [=McCoy=] on the street, Edith walks into traffic to find out what's going on. Kirk instinctively moves to push her out of the way, but Spock insists he not interfere. When [=McCoy=] moves to save her, Kirk restrains him, and Edith is struck by a car and dies, returning history to its original timeline.

[=McCoy=] is shocked and furious, and demands to know why Kirk stopped him from saving Edith. Kirk is too heartbroken to say a word, and Spock gently tells Bones that "he knows". With the timeline restored, the three are able to return to the planet through the portal, where the ''Enterprise'' has reappeared. Scotty expresses surprise at [[YearInsideHourOutside the short time that's elapsed since they left.]] The Guardian offers to show the crew more fantastic journeys, but an emotionally shaken Kirk simply states "Let's get the hell out of here" and prepares to have the crew beamed back aboard.

Presently, IDW is publishing a comic book adaptation of Harlan Ellison's original script of this story.

* AlwaysSaveTheGirl: Played with, since saving Edith would ''doom'' the world.
* AmericaSavesTheDay: Implied that this happened in WorldWarTwo, since America staying out of the war in Europe apparently allows Germany to defeat both Britain & Russia.
* BambooTechnology: Spock has create a massive crude circuit array for his tricorder to display its recordings from the Guardian and he complains that he has to work with the 1930s equivalent tech resources of "bear skins and stone knives."
* BigApplesauce
* BittersweetEnding: Edith dies, but the future continues as normal.
* CutHimselfShaving: Kirk stumbles for an response when a suspicious cop notices Spock's pointed ears. Finally, after Spock suggests "the unfortunate accident I had as a child", he [[BlatantLies explains]] that Spock caught his head in a mechanical rice-picker.
* DramaticShattering: A random vagrant is so frightened by Bones' appearance that he drops a glass bottle of milk.
* ExplosiveInstrumentation: At the beginning of the episode, leading to Bones breaking out the cordrazine.
* FishOutOfTemporalWater
* {{Foreshadowing}}: Almost the first thing to happen to Kirk and Spock when they arrive in the past is that they're nearly run over by a car.
* ForWantOfANail
* GodwinsLawOfTimeTravel
* HomeVersionSoundtrackReplacement: Accidentally averted. The [=DVDs=] were originally going to have "Goodnight, Sweetheart" replaced by generic music for monetary reasons. Then the [=DVDs=] were made with the song still in so Creator/{{Paramount}} paid the money.
* InformedAttribute: For a ''Guardian of Forever'', he certainly doesn't do anything to stop a drug-addled crazy man run into the past and screw with human history, the sort of thing a ''Guardian'' would be expected to prevent. Website/SFDebris had an excellent go at this:
-->'''Chuck!Spock:''' Perhaps your new name could be something like "Butterfingers on the Edge of [[FamilyMatters Whoopsie, Did I Do That?]]"\\
'''Chuck!Guardian''': I've '''succeeded'''! Just in a way [[SufficientlyAdvancedAliens far beyond your comprehension!]]\\
'''Chuck!Spock''': Yeah, that's not working anymore.\\
'''Chuck!Guardian:''' ...Shit.
* KillTheCutie
* {{Leitmotif}}: "Goodnight, Sweetheart" is ''their'' song.
* MadScientistLaboratory: Spock's primitive computer workshop is a small-scale version of this, including an entirely gratuitous Jacob's Ladder.
* MissedHimByThatMuch: [=McCoy=] is led out of the soup kitchen just as Spock shows up to serve.
* NotThatKindOfDoctor: Inverted when Bones tells Edith [[ImADoctorNotAPlaceholder "I'm a surgeon not a psychiatrist."]]
* NotableOriginalMusic: Although this is the only episode to use music not specifically composed for the series, the musical cues featured in the episode are unusual for a different reason. Because the partial score composed for the episode incorporates cues from the copyrighted "Goodnight, Sweetheart", and because this episode aired so late in the first season, ''and'' because new recordings of music were conducted for each season (under union rules), ''all'' of the music composed for this episode is heard ''only'' in this episode - a vanishingly rare case indeed for a show which quite famously reused the same dramatic cues in dozens of episodes.
* PrecisionFStrike: "Let's get the hell out of here." The effect is obviously lost for modern viewers, but "hell" was pretty shocking for 1960s television (contrast Kirk's slightly awkward line "Go to the Devil" from "Day of the Dove"), and they had to fight the network watchdogs to keep it in.
* ResetButton: According to the Guardian, if they were successful in restoring the timeline, "It will be as though none of you had gone". Then, this would indicate that the bum who accidentally killed himself with [=McCoy's=] phaser is restored to life. And from Edith's point of view, she never met any of them before she died. However, Kirk still remembers.
* SaveThisPersonSaveTheWorld: Inverted.
* SequelHook: The Guardian's final words definitely give the impression that the writing staff intended to make further historical stories. Unfortunately, it never happened- at least in this series as it gets a proper sequel in the animated series.
* SetRightWhatOnceWentWrong
* ShootTheShaggyDog
* StatusQuoIsGod: Neither Spock nor Kirk suggests the possibility of taking the forward thinking Edith Keeler back to the future with them instead of letting her get killed 'again'. Perhaps this is what the "Guardian" is guarding against.
* TimeTravelRomance
* TheNeedsOfTheMany
* WhamLine: "Edith Keeler must die."
* WhatTheHellHero: Bones, after Kirk restrains him from saving Edith.
* YouCantFightFate
''"Many such journeys are possible. Let me be your gateway."''