By turns mocking, frustrated and angry, President Obama on Tuesday unleashed a blistering denunciation of Donald Trump, arguing that the presumptive Republican nominee’s rhetoric about Muslims betrays American values and risks helping al-Qaida and the so-called Islamic State.

Obama’s remarks came a day after Trump charged that the president’s refusal to blame attacks like the mass shooting in Orlando on “radical Islam” proved he placed political correctness above the need to keep Americans safe.

The president dismissed Trump’s argument as partisan “yapping,” “a political talking point” and “loose talk and sloppiness” that shows ignorance about how to fight the Islamic State, also known as ISIS or ISIL.

“There has not been a moment in my seven and a half years as president where we have not been able to pursue a strategy because we didn’t use the label ‘radical Islam.’ Not once has an adviser of mine said, ‘Man, if we use that phrase, we are going to turn this whole thing around.’ Not once,” Obama said. “Calling a threat by a different name does not make it go away. This is a political distraction.”

Obama, who emphasized that he has previously detailed how “extremist groups have perverted Islam to justify terrorism,” said language like Trump’s would reinforce the claim that terrorists speak for the world’s 1.7 billion Muslims.

“That’s their propaganda; that’s how they recruit. And if we fall into the trap of painting all Muslims with a broad brush, and imply that we are at war with an entire religion, then we are doing the terrorists’ work for them,” Obama scolded.

The president has faced criticism of his handling of the undeclared but escalating war against ISIS. Top Republicans have accused Obama of neglecting the threat as it flared up and responding too slowly and too meekly. And last weekend’s atrocity in Orlando, now the worst mass shooting in U.S. history, raises fresh questions about the government’s approach to defusing homegrown threats.

Story continues

And a February 2016 poll by the nonpartisan Pew Research Center found that 65 percent of Republicans and independents who lean toward the GOP want the next president to “speak bluntly even if critical of Islam as a whole.” For Democrats and independents who lean left, it was just 22 percent.

The president highlighted Trump’s call for banning Muslim immigration to the United States and his suggestion that some Americans who follow Islam were complicit in the attacks in Orlando and in San Bernardino, Calif.

“Where does this stop?” Obama asked. “Are we going to start treating all Muslim Americans differently? Are we going to start subjecting them to special surveillance? Are we going to start discriminating against them because of their faith?”

The president went on: “That’s not the America we want. It doesn’t reflect our Democratic ideals. It won’t make us more safe, it will make us less safe, fueling ISIL’s notion that the West hates Muslims, making young Muslims in this country and around the world feel like, no matter what they do, they’re going to be under suspicion and under attack.”

“It betrays the very values America stands for,” Obama said. “Do Republican officials actually agree with this?”

Before Obama spoke, Republican House Speaker Paul D. Ryan explicitly rejected Trump’s Muslim immigration ban.

“I do not think a Muslim ban is in our country’s interest,” Ryan told reporters, repeating a point he’s made before. “I do not think it is reflective of our principles not just as a party, but as a country. And I think the smarter way to go in all respects is to have a security test and not a religious test.”

In his remarks on Monday, Trump renewed his call for a Muslim ban, which would include both immigrants and tourists, but he added another layer. Trump said he would “suspend immigration from areas of the world where there’s a proven history of terrorism against the United States, Europe or our allies.”

Obama said “religious tests” have no place in American policy as envisioned by the Constitution and would betray “the very things that make us exceptional.”

“And then the terrorists would have won, and we cannot let that happen,” he said. “I will not let that happen.”