Near the edge of the galaxy, on the recently discovered planet Phylos, Captain Kirk leads a landing party in the exploration of a technologically advanced city that has been overrun with plant life — one specimen of which poisons the botanically minded Lieutenant Sulu. Suddenly a group of walking, intelligent plant creatures approaches and their leader, Agmar, cures Sulu of the deadly plant toxin in his veins.
Agmar tells the landing party of another human who once came among his people, bringing a lethal disease with him. As the plant creatures look on, the landing party enters an enormous laboratory, where the team is attacked by several "swoopers? — flying birdlike creatures that, like Agmar, are also motile plants. Kirk and his officers are further surprised by the unexpected appearance of a giant human who identifies himself as Dr. Keniclius 5, the most recent in a line of cloned replicas of the late twentieth-century genetic scientist Dr. Stavos Keniclius — and whom the local plant beings regard as their "master and savior;? Keniclius 5 turns out to be the human the plant creatures mentioned earlier, the man who brought a disease among them but worked tirelessly until he found a cure for it.
Keniclius 5 captures Spock with the apparent intention to use him as an experimental specimen, but allows the rest of the landing party to return to the Enterprise, where the starship's historical records reveal that the original Dr. Stavos Keniclius had been a specialist in human cloning during the Eugenics Wars of the late twentieth century; Keniclius's research had been banned centuries ago, and the man himself had disappeared. Hoping to fool Keniclius 5 and his Phylosian subjects into believing that he has given up on recovering Spock, Kirk sends the Enterprise out of orbit while taking another landing party down to the surface of Phylos. Protecting themselves from another "swooper? assault with a weed-killer recipe that Dr. McCoy learned from his grandfather, Kirk, McCoy, and Sulu enter a laboratory where they find Spock lying on a table, dying as a result of the transference of his mind into the giant Spock clone — and they encounter Keniclius 5, who introduces the giant clone he has made from Spock's cells.
Keniclius declares his intention to create an immortal army of giant cloned Spocks in order to enforce peace throughout the galaxy. Kirk tells Keniclius 5 that his understanding of current galactic affairs is centuries out of date, explaining that the Federation — which did not exist during the time of the original Dr. Keniclius — has established a widespread state of interstellar peace. Although Keniclius doesn't immediately accept this, the giant Spock proves to be both more logical and more persuadable; using a mind-meld, he restores the dying original Spock to full health. With the giant Spock remaining at his side to assist him, Keniclius 5 finally agrees to lay aside his plans for beneficent galactic conquest, concentrating instead on helping the Phylosians restore their society to its former greatness.