In the year 2274, the remnants of human civilization live in a sealed city contained beneath a cluster of geodesic domes, a utopia run by a computer that takes care of all aspects of life, including reproduction. The citizens live a hedonistic life but, to prevent overpopulation, everyone must undergo the rite of "Carrousel" when they reach the age of 30. There, they are killed under the guise of being "renewed.� To track this, each person is implanted at birth with a "life-clock" crystal in the palm of the hand that changes color as they get older and begins blinking as they approach their "Last Day.� Most residents accept this chance for rebirth, but those who do not and attempt to flee the city are known as "Runners.� An elite team of policemen known as "Sandmen,� outfitted in predominantly black uniforms and serving in an agency of the city called "Deep Sleep,� are assigned to pursue and terminate Runners as they try to escape.
Logan 5 and Francis 7 are both Sandmen. After terminating a Runner, to whose presence they were alerted during a Carrousel rite, Logan finds an ankh among his possessions. Later that evening, he meets Jessica 6, a young woman also wearing an ankh pendant. Logan takes the ankh to the computer, which tells him that it is a symbol for a secret group whose members help the Runners find "Sanctuary,� a mythic place where they will be safe to live out the rest of their lives. Logan learns that the Sandmen have lost 1,056 Runners this way. The computer instructs Logan to find Sanctuary and destroy it, a mission which it code names "Procedure 033-03,� which he must keep secret from the other Sandmen of Deep Sleep. Then, by a procedure it calls "retrogram", the computer changes the color of his life clock to flashing red, suddenly making him four years closer to Carrousel. In order to escape this, Logan is now forced to become a Runner. Logan meets Jessica and explains his situation. They meet with the underground group that leads them to the periphery of the city. Logan learns that the ankh symbol is actually a key that unlocks an exit from the city. They come out into a frozen cave, with Francis following closely behind. In the cave, they meet Box, a robot designed to capture food for the city from the outside. Logan discovers, to his horror, that Box also captures escaped Runners and freezes them for food. Before Box can freeze Logan and Jessica, they escape, causing the cave to collapse on the robot.
Once outside, Logan and Jessica notice that their life clocks are no longer operational. They see the Sun for the first time and discover that the remains of human civilization have become a wilderness. They explore an old, seemingly abandoned city which was once Washington, D.C. In the ruins of the United States Senate chamber, they discover an elderly man living with many cats. His appearance is a shock to them, since neither has ever seen anyone over the age of thirty. The old man recounts what he remembers about what happened to humanity outside the city, and Logan realizes that Sanctuary has always been a myth. However, Francis has followed them and he and Logan fight. Logan fatally wounds Francis; as he dies, Francis sees that Logan's life clock is now clear and assumes Logan has renewed. Logan and Jessica persuade the old man to return to the city with them as proof that life exists outside the domed city. Leaving the man outside, the two enter and try to convince everyone that Carrousel is a lie and unnecessary. The two are captured by other Sandmen and taken to the computer. The computer interrogates Logan about Procedure 033-03 and asks if he completed his mission, but Logan insists, "There is no Sanctuary." What he had found was "old ruins, exposed,� "an old man,� and that the missing Runners were "all frozen.�