[cnn-photo-caption image= http://i2.cdn.turner.com/cnn/2008/images/11/06/art.mccain.obama.jpg caption="Computers at the headquarters of the Obama and McCain campaigns were hacked CNN confirms."]
WASHINGTON (CNN) - Computers at the headquarters of the Barack Obama and John McCain campaigns were hacked in mid-summer by a foreign government or organization, a source with knowledge of the incidents confirms to CNN.
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 whoever was elected.
The FBI is investigating, one of the sources confirmed to CNN. The FBI and Secret Service refused comment on the incidents.
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 headquarters first detected what they thought was a computer virus that was trying to obtain personal information of users.
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.