Edgar Huntly, a young man who lives with his uncle and sisters (his only remaining family) on a farm outside Philadelphia, is determined to learn who murdered his friend Waldegrave. Walking near the elm tree under which Waldegrave was killed late one night, Huntly sees Clithero, a servant from a neighboring farm, half-dressed, digging in the ground and weeping loudly. Huntly concludes that Clithero may be the murderer. He also concludes that Clithero is sleepwalking. Huntly decides to follow Clithero when he sleep walks. Clithero leads Huntly through rough countryside, but all this following doesn't lead to Huntly learning much about the murder. Eventually, Huntly confronts Clithero when they are both awake and demands that he confess. Clithero does confess, but not to Waldegrave's murder. Instead he tells a complicated story about his life in Ireland, where he believes he was responsible for the death of a woman who was his patron, after which he fled to Pennsylvania. Clithero claims to know nothing about Waldegrave's murder.
One night, soon after Huntly goes to sleep in his own bed, he wakes up in a completely dark place made of rock, which he eventually determines is a cave. He is hungry, thirsty, and feels as though he's been beaten. He is attacked by a panther, which he manages to kill and then drinks some of its blood and eats some of its flesh. Looking for his way out of the cave, he finds that some Lenni Lenape, an Indian tribe, are holding a white girl prisoner at the mouth of the cave. Edgar kills the guard and rescues the girl. In their flight, he kills more Indians, who seem to have begun a war. By the end of the novel, Edgar learns (among other things) that he himself has been sleepwalking, that Clithero was indeed not involved in Waldegrave's murder, that Waldegrave was murdered by a Lenni Lenape Indian, perhaps one he himself had killed, and that he and his fiancee are both destined to inherit nothing.