WASHINGTON — American intelligence agencies believe that the Russian government was behind the theft of emails and documents from the Democratic National Committee, but many questions remain about how the documents made their way to WikiLeaks, which released them.

Before the WikiLeaks release, a large sampling was published by several news organizations and a hacker called Guccifer 2.0, who investigators now believe was an agent of the G.R.U., Russia’s military intelligence service.

American intelligence agencies say the earlier leaks from Guccifer and the WikiLeaks material have the same bits of code and telltale metadata traced to previous intrusions attributed to the G.R.U. or the F.S.B., another Russian spy agency. However, Julian Assange, the editor of WikiLeaks, makes a distinction between the Democratic National Committee material he released and the earlier releases by Guccifer and others, saying there is no proof that the Russians gave him the documents.