Updated

President Barack Obama decried what he called the "vicious atmosphere" of national politics and the presidential campaign in a speech Tuesday that included several swipes at Republican front-runner Donald Trump.

Without mentioning the GOP candidate by name, Obama used a luncheon at the Capitol to express his concern about the nation's political discourse and the protests that have escalated to violence at several of Trump's rallies.

"We have heard vulgar and divisive rhetoric aimed at women and minorities, and Americans that don't look like us or pray like us or vote like we do," said Obama, who added that political leaders could either condone "this race to the bottom" or reject it.

Obama also emphasized that efforts to shut down free speech were "misguided." Protesters forced Trump to cancel a rally in Chicago on Friday. The president said he rejected "any effort to spread fear or encourage violence or shut people down while they are trying to speak."

"We live in a country where free speech is one of the most important rights that we hold. In response to those events we've seen actual violence, and we've heard silence from too many of our leaders," Obama said.

Trump's political rivals and others blame him for sowing division, rather than unity, across the country. Trump says he's done no such thing and calls himself a "uniter."

Obama said that while some may bear more of the blame for the ugly political climate, everyone bears responsibility for reversing it.

"It is a cycle that is not an accurate reflection of America. It has to stop," Obama said. "And I say that not as a matter of political correctness, it's about the way that corrosive behavior can undermine our democracy and our society and even our economy."

The president reminded the audience of Republicans and Democrats, including House Speaker Paul Ryan, R-Wis., that the world is watching the U.S. candidates and what they say.

"In America there aren't laws that say we have to be nice to each other ... But there are norms, there are customs, there are values that our parents taught us and that we try to teach to our children," the president said.

Ryan said earlier Tuesday that all candidates have an obligation to do what they can to provide an atmosphere of harmony at campaign events and not incite violence.

Obama said he appreciated Ryan's comments. And he said that even though the two men disagree on politics, he would not insult the House speaker "as a man."

"The point is we can have political debates without turning on one another," Obama said. "We can disagree without assuming it is motivated by malice."

Senate Majority Leader Mitch McConnell, R-Ky. said he spoke to Trump on Tuesday and asked him to condemn violence, no matter who is responsible. It was the first time the two men have spoken since December.

"I appreciate his call, and I took the opportunity to recommend to him that no matter who may be triggering these violent expressions or conflicts that we have been seeing at some of these rallies, it might be a good idea to condemn that and discourage it no matter what the source of it is," McConnell said.

Obama received a standing ovation at the conclusion of his remarks.

The Associated Press contributed to this report.