The U.S.S. Enterprise answers an old distress signal to find an unnamed planet that is almost an exact duplicate of Earth in the 1960s. A landing party beams down and discovers that 300 years before, the natives of the planet conducted experiments to prolong life, but had instead created a deadly virus. The virus killed all adults by rapid aging and madness. In children, the virus slowed the natural aging process greatly, leaving them in a state of prepubescence for centuries.
There are no adults on the planet, only children, and they survive the best they can without adults to aid them. The landing party contracts the virus, except for Spock, who becomes a carrier of the disease. Until a cure for the disease can be found and created, the landing party is confined to the planet. To return to the U.S.S. Enterprise would mean a rapid spread of the disease.
The landing party attempts to make friends with the children, but they vividly remember the horrible deaths of their parents and refuse to have anything to do with them. One of the older children, Miri, falls in love with Kirk and tries to help him with the other children until she begins to see Yeoman Rand as a rival for the captain's affections. Stung, Miri helps Jahn, one of the boys, to lead the children in a campaign to harass the U.S.S. Enterprise crew members. When Kirk tries to reason with the children, he is badly beaten.
One of the older children begins to exhibit symptoms of the disease and Kirk convinces them that they all will get the virus and die horribly, when they finally reach puberty. Using himself as a guinea pig, McCoy creates an antidote from old research notes found in the planet's lab, and finds the cure. The doctor says that the Federation will probably send supervisory personnel to colonize the planet and take care of the children.