WASHINGTON (CNN) -- Computers at the headquarters of the Barack Obama and John McCain campaigns were hacked during the campaign by a foreign entity looking for future policy information, a source with knowledge of the incidents confirms to CNN.
Workers at Barack Obama's headquarters first thought there was a computer virus.
The source said the computers were hacked mid-summer by either a foreign government or organization.
Another source, a law enforcement official familiar with the investigation, says federal investigators approached both campaigns with information the U.S. government had about the hacking, and the campaigns then hired private companies to mitigate the problem.
U.S. authorities, according to one of the sources, believe they know who the foreign entity responsible for the hacking is, but refused to identify it in any way, including what country.
The source, confirming the attacks that were first reported by Newsweek, said the sophisticated intrusions appeared aimed at gaining information about the evolution of policy positions in order to gain leverage in future dealings with whomever was elected.
The FBI is investigating, one of the sources confirmed to CNN. The FBI and Secret Service refused comment on the incidents. Watch Brian Todd's report on the investigation. »
The sources refused to speak on the record due to the ongoing investigation and also because it is a sensitive matter involving presidential politics.
As described by a Newsweek reporter with special access while working on a post-campaign special, workers in Obama's headquarters first detected what they thought was a computer virus that was trying to obtain users' personal information.
The next day, agents from the FBI and Secret Service came to the office and said, "You have a problem way bigger than what you understand ... you have been compromised, and a serious amount of files have been loaded off your system."
One of the sources told CNN the hacking into the McCain campaign computers occurred around the same time as the breach into those of Obama's campaign.
Representatives of the campaigns could not be reached for comment on the matter.