In the Black Hills of Dakota, shortly before the territory enters the United States in 1889, a man named Jim Trunsdale is arrested by Sheriff Barclay and his deputies for the robbery and murder of a young girl, Rebecca Cline. Jim is accused because his treasured hat was found inside Rebecca's dress and he couldn't account for the hat when he was arrested. Rebecca's body is missing her silver dollar, and the Sheriff suspects her murderer took it. He's unable to find the dollar on Jim after a strip-search and there is no record of Jim spending it. In court, the trial judge also serves as the prosecuting attorney and nobody objects to this situation, even as it contributes to an unfair trial, as the townsfolk want to see somebody charged for the heinous crime. However, the Sheriff begins to suspect that Jim might be innocent. Jim's simple-mindedness and honesty, the absence of the silver dollar on him, and the sham judicial trial are all contributing factors. Jim is nonetheless found guilty and gallows are erected for his execution the following day. Jim asks for his favorite meal as his last one the night before his execution, which the Sheriff pays for out of pocket out of pity. Jim then becomes stressed, worrying that the food will not get to naturally pass through his body before he is hanged. In a final attempt to help Jim, the Sheriff tries to help him remember whether or not he was still in possession of his hat on the day of the murder. Nobody else could remember if Jim had his hat and neither can Jim. On the day of the execution, Jim is taken up the steps to the gallows. He thrashes while being taken up and requests to be allowed to see the mountains before he dies. He is refused his request and is executed to the recitation of Psalm 51 by the priest and the jeers and taunts of the crowd who have come to watch. The Sheriff returns to the jail that had held Jim before the execution and vomits into Jim's waste bucket. The local undertaker swings by and tells the Sheriff that there is something he needs to see at the mortuary. The undertaker informs the Sheriff that he found the missing silver dollar in Jim's bowels. The Sheriff realizes that Jim was indeed actually guilty of the crime all along, as the silver dollar was the one that was robbed from Rebecca Cline. After murdering Rebecca, Jim had swallowed the silver dollar, then swallowed it again every time he defecated in his cell in an attempt to conceal the evidence of his crime. The Sheriff is amazed that he thought Jim was innocent up until the very end, and remarks that Jim is probably standing at the throne of God still insisting on his innocence. Outside, a church congregation sings the Doxology.