At a news conference in December, President Obama made it clear that he was not aware of any of this until mid-2016, nearly a year after the hacking began and the British had sent up a flare.

“At the beginning of the summer,” Mr. Obama said, “we’re alerted to the possibility that the D.N.C. has been hacked, and I immediately order law enforcement as well as our intelligence teams to find out everything about it” and to brief “potential victims” and “the relevant intelligence agencies.”

It was not until Oct. 7, 2016, 15 months after the initial hacking attack, that the intelligence agencies first publicly blamed Russia. Even then, Mr. Obama made it clear that he did not want to escalate the situation before the election, for fear of getting into a tit-for-tat cyberwar in which Russia might try to alter the actual vote tallying. (It did not.)

“We were just too slow, at every turn,” one of Mr. Obama’s top aides said in an interview late last year.

The director of the N.S.A., Adm. Michael S. Rogers, has said the problem was hardly limited to this case. “The biggest frustration to me is speed, speed, speed,” he told the Senate Armed Services Committee on Thursday, in response to a question from Senator Jack Reed of Rhode Island, the top Democrat on the panel, about the obstacles to seeing a threat from abroad and acting on it here in the United States.

“We have got to get faster; we’ve got to be more agile,” said Admiral Rogers, who clashed with White House officials when they thought he was acting too slowly against the Islamic State. “We can’t be bound by history and tradition here. We have to be willing to look at alternatives.”

Mr. Putin, for his part, played a weak hand skillfully, blending old information-warfare techniques with the echo chamber created by the internet. It is clear that Mr. Putin saw a huge vulnerability in the American system that was ripe to be exploited.