The City on the Edge of Forever was an episode of the original series of Star Trek, first broadcast on April 6, 1967. It was written by noted science-fiction author Harlan Ellison, who remains annoyed and bitter to this day at Gene Roddenberry's rewritten version that was filmed instead. His original script is now available in book form.

In the filmed version, the USS Enterprise crew discover a time portal on a planet. Leonard McCoy goes through this portal, and the crew find themselves cut off from the starship. Mr. Spock's tricorder suggests that the starship no longer exists, and they deduce that McCoy has interfered with the past somehow. They go through the portal themselves, and discover McCoy in 1930s America.

They conclude that the specific interference would be McCoy saving the life of Edith Keeler (played by Joan Collins) - as this would apparently then led to her continuing anti-war activism, leading to a delayed United States entry into World War II and hence a Nazi Germany victory. Kirk, having fallen in love with her in the meantime, prevents McCoy from doing so, and they return home.

The portal is revisited in the animated series episode Yesteryear, and numerous books.