MUNICH (Reuters) - Senator John McCain, defending the media against the latest attack by President Donald Trump, warned that suppressing the free press was "how dictators get started".

The Arizona Republican, a frequent critic of Trump, was responding to a tweet in which Trump accused the media of being “the enemy of the American people”.

The international order established after World War Two was built in part on a free press, McCain said in an excerpt of an interview with NBC's "Meet the Press" that was released in advance of the full Sunday morning broadcast.

"I hate the press. I hate you especially," he told interviewer Chuck Todd from an international security conference in Munich. "But the fact is we need you. We need a free press. We must have it. It's vital."

"If you want to preserve - I'm very serious now - if you want to preserve democracy as we know it, you have to have a free and many times adversarial press. And without it, I am afraid that we would lose so much of our individual liberties over time. That's how dictators get started," he continued.

"They get started by suppressing free press. In other words, a consolidation of power. When you look at history, 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," McCain said.

U.S. Senator Jeanne Shaheen, a Democrat from New Hampshire, told the conference on Sunday she was also concerned about Trump's comments.

"The real danger is the president’s criticism of the media," Shaheen told the conference. "A free press ... is very important to maintaining democracy, and efforts on the part of a president to undermine and manipulate the press are very dangerous."

The comments from U.S. lawmakers followed Trump’s tweet and came days after the president held a raucous news conference at which he repeatedly criticized news reports about disorder in the White House and leaks of his telephone conversations with the leaders of Mexico and Australia.

German Chancellor Angela Merkel emphasized the importance of a free press at the conference on Saturday, saying, "I have high respect for journalists. We've always had good results, at least in Germany, by relying on mutual respect."

(Reporting by Jonathan Landay and Andrea Shalal; Editing by Mark Potter and David Stamp)