As the story opens, the banker recalls the occasion of the bet fifteen years before. Guests at the party that he was hosting that day fell into a discussion of capital punishment; the banker argued that capital punishment is more humane than life imprisonment, while the young lawyer disagreed, insisting that he would choose life in prison rather than death. They agree to a bet of two million rubles that the lawyer cannot spend fifteen years in solitary confinement. The bet was on, and the lawyer cast himself into isolation for fifteen years.
The man spends his time in confinement reading books, writing, playing piano, studying, drinking wine, and educating himself. We find him continuously growing throughout the story. We see various phases in his term of imprisonment over the years. At first, the lawyer suffered from severe loneliness and depression. But soon began studying vigorously. He begins with languages and other related subjects. Then, a mix of science, literature, philosophy and other seemingly random subjects. He ends up reading some six hundred volumes in the course of four years. Then, the Gospel followed by theology and histories of religion. In the final two years, the imprisoned lawyer read immensely on chemistry, medicine and philosophy, and sometimes works of Byron or Shakespeare.
In the meantime, the banker's fortune declines and he realizes that if he loses, paying off the bet will leave him bankrupt.
The day before the fifteen-year period concludes, the banker resolves to kill the lawyer so as to not owe him the money. On his way to do so, however, the banker finds a note written by the lawyer. The note declares that in his time in confinement he has learned to despise material goods as fleeting things and he believes that knowledge is worth more than money. To this end he elects to renounce the reward of the bet. The banker was moved and shocked to his bones after reading the note, kisses the strange man on the head and leaves the lodge weeping, relieved not to have to kill anyone. The prison warden later reports that the lawyer has left the guest house, thus losing the bet and unwittingly saving his own life.