John Murdoch awakens in a hotel bathtub, suffering from amnesia. He receives a phone call from Dr. Daniel Schreber, who urges him to flee the hotel to evade a group of men who are after him. In the room, Murdoch discovers the corpse of a ritualistically murdered woman along with a bloody knife. He flees the scene, just as the group of pale men in trenchcoats (later identified as "the Strangers") arrive.
Following clues, Murdoch learns his own name and finds out he has a wife named Emma; he is also sought by Police Inspector Frank Bumstead as a suspect in a series of murders committed around the city, though he cannot remember killing anybody. Pursued by the Strangers, Murdoch discovers that he has psychokinesis�which the Strangers also possess, and refer to as "tuning" the ability to alter reality at will. He manages to use these powers to escape from them.
Murdoch explores the anachronistic city, [8] where nobody seems to realize it is always night. At midnight, he watches as everyone except himself falls asleep as the Strangers physically rearrange the city as well as change people's identities and memories. Murdoch learns that he came from a coastal town called Shell Beach: a town familiar to everyone, though nobody knows how to get there, and all of his attempts to do so are unsuccessful for varying reasons. Meanwhile, the Strangers inject one of their men, Mr. Hand, with memories intended for Murdoch in an attempt to predict his movements and track him down.
Murdoch is eventually caught by Inspector Bumstead, who acknowledges that Murdoch is most likely innocent, and by then has his own misgivings about the nature of the city. They confront Schreber, who explains that the Strangers are extraterrestrials who use corpses as their hosts. Having a hive mind, the Strangers are experimenting with humans to analyze their individuality in the hopes that some insight might be revealed that will help their race survive.
Schreber reveals that Murdoch is an anomaly who inadvertently awoke when Schreber was in the middle of imprinting his latest identity as a murderer. The three embark to find Shell Beach, but it exists only as a poster on a wall at the edge of the city. Frustrated, Murdoch and Bumstead break through the wall, revealing outer space. The men are confronted by the Strangers, including Mr. Hand, who holds Emma hostage. In the ensuing fight, Bumstead and one of the Strangers fall through the hole into space, revealing the city as a deep space habitat surrounded by a force field.