WASHINGTON — Senator Jeff Flake, Republican of Arizona, took to the Senate floor on Wednesday to castigate President Trump for his “assaults” on American media and to compare the president’s words to those of a former Soviet dictator who slaughtered millions of his own citizens in a reign of terror.

“It is a testament to the condition of our democracy that our own president uses words infamously spoken by Joseph Stalin to describe his enemies,” Mr. Flake said, referring to the former Soviet dictator who regularly used the phrase “enemy of the people,” which Mr. Trump has borrowed.

“When a figure in power reflexively calls any press that doesn’t suit him ‘fake news,’ it is that person who should be the figure of suspicion, not the press,” Mr. Flake said.

Mr. Flake had promised to speak out against Mr. Trump’s “reckless, outrageous and undignified” behavior when he announced in October that he would retire at the end of the year. True to his word, Mr. Flake delivered his remarks on the day the president had said he would issue “Fake News Awards” to “the most corrupt & biased of the Mainstream Media.”