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

Sen. John McCain is taking a veiled swipe at President Donald Trump's ongoing attack on the fourth estate, cautioning that "how dictators get started" is by shutting down the press.

The Republican Arizona senator, in an exclusive interview on Meet the Press airing Sunday, admitted that the relationship between the media and elected officials can sometimes be tense — highlighted by the Trump administration's repeated sparring with reporters and the president calling news organizations "fake news."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Watch the interview with Sen. McCain on Sunday on NBC's Meet the Press

Half-jokingly, McCain said, "a fundamental part of that new world order was a free press. I hate the press. I hate you especially. But the fact is we need you."

His defense of the media came in response to a Friday tweet from President Donald Trump in which he called certain news outlets "the enemy of the American People."

Speaking from Germany, where he was attending the Munich Security Conference, McCain said that without a free press, "I am afraid that we would lose so much of our individual liberties over time. That’s how dictators get started."

McCain clarified that he wasn't referring to the president as a dictator, but that attacks on journalists who are questioning those in power are usually a hallmark of autocratic governments.

"When you look at history," McCain said, "the first thing that dictators do is shut down the press. And I’m not saying that President Trump is trying to be a dictator. I’m just saying we need to learn the lessons of history."