The Russians were as surprised as everyone else at Mr. Trump’s victory, intelligence officials said. Had Mrs. Clinton won, they believe, emails stolen from the Democratic committee and from senior members of her campaign could have been used to undercut her legitimacy. The intelligence agencies’ conclusion that Russia tried to help Mr. Trump was first reported by The Washington Post.

In briefings to the White House and Congress, intelligence officials, including those from the C.I.A. and the National Security Agency, have identified individual Russian officials they believe were responsible. But none have been publicly penalized.

It is possible that in hacking into the Republican committee, Russian agents were simply hedging their bets. The attack took place in the spring, the senior officials said, about the same time that a group of hackers believed to be linked to the G.R.U., Russia’s military intelligence agency, stole the emails of senior officials of the Democratic National Committee. Intelligence agencies believe that the Republican committee hack was carried out by the same Russians who penetrated the Democratic committee and other Democratic groups.

The finding about the Republican committee is expected to be included in a detailed report of “lessons learned” that Mr. Obama has ordered intelligence agencies to assemble before he leaves office on Jan. 20. That report is intended, in part, to create a comprehensive history of the Russian effort to influence the election, and to solidify the intelligence findings before Mr. Trump is sworn in.

Mr. Trump has repeatedly cast doubt about any intelligence suggesting a Russian effort to influence the election. “I don’t believe they interfered,” he told Time magazine in an interview published this week. He suggested that hackers could come from China, or that “it could be some guy in his home in New Jersey.”

Intelligence officials and private cybersecurity companies believe that the Democratic National Committee was hacked by two different Russian cyberunits. One, called “Cozy Bear” or “A.P.T. 29” by some Western security experts, is believed to have spent months inside the D.N.C. computer network, as well as other government and political institutions, but never made public any of the documents it took. (A.P.T. stands for “Advanced Persistent Threat,” which usually describes a sophisticated state-sponsored cyberintruder.)