The Russian Secret Police, known as the NKVD, arrest Rubashov in the middle of the night, which is not only terrifying, but hugely coincidental because the arrest wakes Rubashov from a dream in which he is being arrested by the Nazi military police, the Gestapo. The older of the two men arresting him is about the same age as Rubashov, and treats him with a certain respect and civility, but the younger is uncouth and aggressive, leading Rubashov to conclude that the youth of today have no class and are barbaric and vulgar.
Strangely, imprisonment is at first a relief to Rubashov because it means he no longer has to worry about being arrested. He fully expects to be kept in solitary confinement until he is shot. The man in the cell next to his is Prisoner Number 402. They begin communicating via knock code, spelling out words and phrases by tapping or knocking on their communal wall. It doesn't take Rubashov long to realize that he has nothing in common with Number 402, who is positively gleeful that one of the communists he hates has been arrested. They plod on with their communication, however, and eventually come to bond a little, exchanging information about their fellow prisoners and their backgrounds.
Rubashov spends a great deal of time thinking over his life. He has been a respected man, commended for his fearlessness in the field, given difficult and dangerous assignments and even been tortured, proving his loyalty to the Party and its objectives. Lately, though, he has been rethinking this loyalty because the Party he once believed in has turned into something different and the two decades of mass executions and the deaths of millions of people, the Utopian society that was promised still seems just as far away into the future as it ever was. Rubashov is torn between continued loyalty and his own conscience which is telling him in no uncertain terms that the Party vision was just that - a vision.
Rubashov is struggling to place himself in the context of history; how will the Marxists interpret the Old Bolsheviks in general and himself in particular?
After about a week in prison, Rubashov is brought in for his first hearing. It is presided over by someone he knows, and with whom he was friends; Ivanov is a Civil War veteran and an Old Bolshevik, and he has the same view of the Revolution as Rubashov. Things seem positive, and Ivanov, who owes Rubashov his life, wants to lessen his sentence if he can. He tells Rubashov that if he confesses to the charges against him, he will consider his debt closed, and Rubashov's sentence will be shortened to five or ten years in a labor camp, instead of execution. The charges are not relevant because Rubashov hasn't actually done anything; both men seem to know this. Rubashov tells Ivanov that he is tired of these games but Ivanov urges him to think it over, so that they can both live long enough to witness the utopia they have both worked towards creating their entire lives.
Ivanov and his junior, Gletkin, discuss the Rubshov situation. Gletkin is a proponent of brutality forcing a confession from his prisoners, but Ivanov assures him that Rubashov will come to the conclusion that confessing is the only logical thing to do. Gletkin is unhappy; he has never seen anything other than brutality work when it comes to convincing the masses. Ivanov feels contemptuous of this viewpoint although he has to admit that their is some truth in it.
Gletkin takes charge of Rubashov's interrogation, and immediately uses some of the brutal physical punishments he is such a fan of. These include sleep deprivation and shining a lamp in Rubashov's face for hours. None of these methods work until Rubashov learns that Ivanov has been killed. This breaks his resolve and he confesses. He can't help thinking about the many agents he himself betrayed during the course of his career, and understands that the treatment he is receiving now is a case of his chickens coming home to roost; as he has sewn, so shall he reap. He is still loyal to the Party, even though this loyalty is clearly misplaced, and the Party he became so loyal too no longer exists in the same way anymore. He confesses fully, in public.
At the end of the novel, Rubashov is executed.