Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

Foreign hackers may have the campaigns of U.S. presidential candidates in their sights, the nation's top intelligence official warned Wednesday.

The FBI and Homeland Security are working with the campaigns to tighten security and prevent the cyber intruders from penetrating their defenses, Director of National Intelligence James Clapper said.

Clapper warned that there are likely to be cyber attacks as Hillary Clinton and Bernie Sanders battle for the Democratic nomination and Donald Trump tries to rally Republican support for his candidacy. He did not say what actual attacks on the campaigns, if any, have already occurred.

Byers Market Newsletter Get breaking news and insider analysis on the rapidly changing world of media and technology right to your inbox. This site is protected by recaptcha

"We have already had some indications of that, and a combination of DHS, FBI are doing what they can to educate both candidates of potential cyber threats," Clapper said, without specifying which candidates they were advising. "I anticipate as the campaigns intensify we will probably have more of it.

The Office of the Director of National Intelligence clarified Clapper's comments somewhat in a tweet later on Wednesday, saying that "we're aware that campaigns and related organizations and individuals are targeted by actors with a variety of motivations."

Following up on DNI Clapper's response to a #BPClive query about cyber attacks on presidential campaign websites: pic.twitter.com/5pycu5QlHW — Office of the DNI (@ODNIgov) May 18, 2016

Meanwhile, a senior U.S. intelligence official told NBC News, "All of the candidates have been spoken to, and their campaigns."

But some are more prepared for this kind of threat than others, the official said.

"Most worried about Trump, who has no experience with government computer systems or protocols," the official said.

Foreign hacking against American political candidates is not new. There was evidence of it happening during the 2008 presidential election won by President Obama, Clapper said.

NBC News reported in 2013 that prior to the 2008 presidential election, Chinese cyber spies had targeted the presidential campaigns of then Sen. Obama and Sen. John McCainin order to read emails and policy papers.

The hackers successfully compromised some emails, including private correspondence from McCain, NBC News reported.

Also, both Obama's and GOP candidate Mitt Romney's campaigns were hit by Chinese cyber-attacks during the 2012 election.

"Campaigns and related organizations and individuals are targeted by actors with a variety of motivations, from philosophical differences to espionage" with varying capabilities "from defacements to intrusions," said Brian Hale, an intelligence community spokesman.