President Obama had some strong words for Republican candidates—especially party frontrunner Donald Trump—who have been warning that Muslims pose a threat in the United States.

“We need to reject any politics that targets people because of race or religion,” he said. “This isn’t a matter of political correctness. It’s a matter of understanding what makes us strong.”

Trump proposed a temporary ban on all Muslims from entering the United States after the terrorist attacks in Paris and San Bernardino, Calif., and he often mocks the positions of his opponents as “politically correct.”

Obama warned that Trump and others could hurt the country. “When politicians insult Muslims, when a mosque is vandalized, or a kid bullied, that doesn’t make us safer. That’s not telling it like it is,” he said. “It’s just wrong. It diminishes us in the eyes of the world. It makes it harder to achieve our goals. And it betrays who we are as a country.”

Trump seemed unfazed by the jab.

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Charlotte Alter at charlotte.alter@time.com.