The Arizona Republican -- who has recently criticized policies backed by Trump -- told midshipmen that democracies need to recognize the risks these groups pose, saying "it's time to wake up."
"(W)e are asleep to the necessity of our leadership, and to the opportunities and real dangers of this world,"
. "We are asleep in our echo chambers, where our views are always affirmed and information that contradicts them is always fake. We are asleep in our polarized politics, which exaggerates our differences, looks for scapegoats instead of answers."
McCain said World War II-era American statesmen knew "that tyranny is always a threat to peace" and that "there could be no more isolationism, no more tired resignation -- no more 'America First'" -- a phrase often touted by Trump.
McCain also alluded to the US-Mexico border wall proposed by Trump.
"We have to remind our sons and daughters that we became the most powerful nation on earth by tearing down walls, not building them," he said.
Modern-day politics, McCain suggested, are on a path toward ruining fragile western institutions.
"How did we end up here?" he reflected. "Why do many Americans ignore our moral and historical knowledge and seek escape from the world we've led so successfully?"
The senator said the era for global success of democracy has shifted to "a time in which the seductions of authoritarian rule find favor with many; when self-interested leadership excuses naked aggression with weak rationalizations; when ethnic grievances haunt the old and religious fanaticism fires the minds of the misguided young."
"We have to fight," he added. "We have to fight against propaganda and crackpot conspiracy theories. We have to fight isolationism, protectionism and nativism. We have to defeat those who would worsen our divisions."
McCain, who was the target of occasional attacks from Trump during the 2016 campaign, has stepped up his criticism of Trump in recent weeks. Earlier this month, he warned against
"half-baked, spurious nationalism" while accepting the Liberty Medal from former Vice President Joe Biden.
And last week, McCain, who spent five years as a prisoner of war during the Vietnam War, appeared to mock
Trump's draft deferments when he criticized people from "the highest income level" who avoided the draft by finding a doctor who "would say that they had a bone spur."
Trump obtained a medical deferment after he was diagnosed with bone spurs in his foot. McCain later said
the comment was not specifically about Trump.
McCain's criticisms at the President have been joined by other notable Republicans, including former President George W. Bush
-- who, like McCain, declined to call out Trump by name despite slamming his policies in a speech earlier this month -- Sen. Bob Corker
, R-Tennessee, and Sen. Jeff Flake
Flake hailed McCain's Annapolis speech Tuesday morning.
"Great man, great speech," Flake wrote.