(CNN) President Donald Trump's stated openness to foreign intelligence undermines the efforts of the US intelligence community, Gen. Michael Hayden said in an interview that aired on "CNN Tonight" Friday.

Hayden, former director of both the CIA and National Security Agency, was making his first appearance on CNN since suffering a stroke last fall. He was asked by CNN's Don Lemon about comments made by Trump in an interview with ABC News that aired on June 12.

In that interview, Trump said he would listen if a foreign government approached him with damaging information about a political rival -- and he wouldn't necessarily report the contact to the FBI.

"It's awful. It's awful," Hayden told Lemon, adding that kind of rhetoric harms intelligence agents' abilities to do their jobs. "Now the next day, they go to work and do the best they can. But, you know, that's really hard."

Trump has consistently expressed nonchalance over foreign efforts to influence US politics. He downplayed Russian efforts to interfere in the 2016 contest and cast doubts on US intelligence agencies' assessments of the meddling.

Read More