“Moscow is silent,” an officer told him. He would recall that phrase again and again in the years that followed.

“I had the feeling then that the country was no more,” he said later.

His friend Sergei Roldugin said he had never seen Mr. Putin so emotional as when he spoke about those East German informants whose identities had been revealed. “He said it was equal to treason,” Mr. Roldugin told Mr. Putin’s biographer, Steven Lee Myers. “He was very upset, extremely.”

Scores of intelligence agents turned to the West at that time, as defectors or informants, and Mr. Putin cannot speak of them without a lip curl of disgust. They are “beasts” and “swine.” Treachery, he told one interviewer, is the one sin he is incapable of forgiving. It could also, he said darkly, be bad for your health. “Traitors always meet a bad end,” he once said. “As a rule they either die of heavy drinking or drug abuse.”

When he came to power, Mr. Putin went after traitors the same way he dealt with other ills of the chaotic 1990s, the oligarchs and crime bosses. His first years in office were marked by a barrage of spy convictions, some clearly meant as revenge.

The tone was set around the time of Mr. Putin’s first election as president in 2000 — the day before, in fact. That was when the Federal Security Service, which Mr. Putin had recently commanded, leaked the identity of a British MI6 officer who was a prodigious recruiter of Russian spies. It was a careful, meticulous leak, intended to savage the man’s career, a deliberately personal attack: The spy service also revealed the officer’s wife’s name and the fact that he had two daughters.

That officer, it was later revealed, was the man who had recruited Mr. Skripal.

A Family Collapses