Mr. Kaine declined to be interviewed. But in a 2009 interview with The Virginian-Pilot toward the end of his term, he said each clemency decision had been “very painful,” though his experience as a lawyer had prepared him.

“I’ve eaten the last meal, and I’ve held the guy’s hand, and I’ve been to the Supreme Court, and I’ve been to the protests, and I know this very, very well,” he said. “And because of that, it was kind of demystified.”

Mr. Kaine was a new associate at a Richmond law firm, specializing in civil litigation but eager to carve out a portfolio in civil rights, in the mid-1980s when he took the first of two pro bono capital punishment cases he would handle. His client was Richard Lee Whitley, convicted of murder for strangling and slitting the throat of an elderly female neighbor, and then sexually assaulting her corpse, after an alcohol and drug binge.

It was “not a sympathetic case,” but Mr. Kaine, driven by his faith, “was extremely passionate about it,” said his co-counsel, Tom Wolf, later Mr. Kaine’s law partner and close friend. “He said there were a lot of people on death row who hadn’t had a fair trial, and there were not nearly enough lawyers willing to take those cases.”

Virginia’s Supreme Court declined to block the execution, so Mr. Kaine turned to the federal courts. He argued that Mr. Whitley had not received a fair trial, because his court-appointed lawyer had failed to investigate or introduce evidence of the psychological damage Mr. Whitley had suffered as a child.

The judges, Mr. Wolf said, “didn’t buy it.”

Neither did the Supreme Court, which rejected Mr. Kaine’s request for a stay after Virginia’s governor, Gerald L. Baliles, refused a petition for clemency. On July 6, 1987, Mr. Whitley was executed in the electric chair. Mr. Kaine did not witness it — Mr. Whitley did not want him to, a Kaine aide said — but was intent on being with him in the hours before his death. Along with a priest, they shared Mass and the condemned man’s last meal.