The second group, named Fancy Bear, which appeared to have attacked in April, is believed to be operated by the G.R.U., the military intelligence service. Its past targets have included military and aerospace organizations from the United States, Europe, Canada, Japan and South Korea.

CrowdStrike concluded that neither Russian group knew the other was attacking the same organization. “One would steal a password, and the next day the other group would steal the same password,” Mr. Alperovitch said.

Mrs. Clinton said on Telemundo that she had learned of the breach only after news outlets reported it. She called it “troubling,” but said she was unsure about the hackers’ goals.

“Now, why?” she asked. “We don’t know yet. So far as we know, my campaign has not been hacked into, and we’re obviously looking hard at that. But cybersecurity will be an issue that I will be absolutely focused on as president. Because whether it’s Russia, or China, Iran or North Korea, more and more countries are using hacking to steal our information, to use it to their advantage, and we can’t let that go on.”

The Office of Personnel Management, whose files on about 22 million Americans with security clearances or applications for them were breached by Chinese hackers, is still trying to assess the damage first detected last year.

The Democratic committee avoided any discussion of its vulnerabilities.

“The security of our system is critical to our operation and to the confidence of the campaigns and state parties we work with,” said Representative Debbie Wasserman Schultz of Florida, the Democratic national chairwoman. “When we discovered the intrusion, we treated this like the serious incident it is and reached out to CrowdStrike immediately. Our team moved as quickly as possible to kick out the intruders and secure our network.”

The party did not say how it came to suspect the intrusion.

Cyberattacks by foreign governments are a constant threat to political campaigns. Because campaign operations are temporary, they often do not invest heavily in the kind of security that financial institutions, large companies and government agencies spend millions or billions of dollars on each year.