WASHINGTON -- President Donald Trump called the free and independent U.S. press "enemies of the American people," and a leading U.S. senator said "that's how dictators get started."

Trump used Twitter to deride three major television networks, the leading U.S. newspaper and a cable news channel, all of which have covered his actions as president, including signing an executive order on immigration that was overturned by the courts and accepting the resignation of his national security adviser following reports that he talked to Russian officials during the presidential campaign.

A fellow Republican, U.S. Sen. John McCain of Arizona, said a free press was needed "to preserve democracy as we know it" in an interview airing Sunday on NBC's "Meet the Press."

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

McCain, the 2008 Republican presidential nominee who has called for a probe into possible ties between Trump and Putin, said a free press is the first casualty of someone seeking absolute power.

"When you look at history, the first thing that dictators do is shut down the press," McCain said. "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."

The First Amendment to the Constitution protects freedom of the press.

Trump, the most unpopular president in decades, has been critical of news coverage of his campaign and after his unexpected victory in November.

His campaign website includes a "mainstream media accountability survey," asking if the media "has been far too quick to spread false stories about our movement," if it "creates false feuds" within the GOP, and whether the Republican Party "should spend more time and resources" to hold journalists accountable.

He has been called out by U.S. journalists for giving out erroneous information, such as the size of the crowd that witnessed his inauguration, and has been questioned over possible ties to Russian President Vladimir Putin, who U.S. intelligence agencies said ordered actions designed to benefit Trump in the presidential election.

Trump feuded with then-Fox News Channel host Megyn Kelly, even skipping a debate sponsored by the cable station; refused to answer a question asked by a CNN reporter at his only press conference as president-elect; and said the opinions of allied conservative commentators carry more weight than the independent reporting of U.S. media outlets, such as those covering Thursday's event.

Thank you for all of the nice statements on the Press Conference yesterday. Rush Limbaugh said one of greatest ever. Fake media not happy! — Donald J. Trump (@realDonaldTrump) February 17, 2017

"One of the most effective press conferences I've ever seen!" says Rush Limbaugh. Many agree.Yet FAKE MEDIA calls it differently! Dishonest — Donald J. Trump (@realDonaldTrump) February 17, 2017

Jonathan D. Salant may be reached at jsalant@njadvancemedia.com. Follow him on Twitter @JDSalant. Find NJ.com Politics on Facebook