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 he 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, the banker finds the lawyer sleeping at a table along with a note he has written. The note declares that during his time in confinement he has learned to despise material goods as fleeting things, and he believes that divine salvation is worth more than money. To this end the lawyer elects to renounce the reward of the bet. The banker was moved and shocked after reading the note, kisses the lawyer 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 on the day before the fifteen year mark, thus losing the bet. The banker takes the note and locks it in his safe.