President Barack Obama asserted Tuesday that proposals from presumptive GOP presidential nominee Donald Trump would strengthen Islam-inspired terrorist groups, but he emphasized that he will "not let that happen."

Obama warned that proposals from politicians like Trump seeking to increase surveillance of American Muslims or create a religious test for who can enter the country are antithetical to America's core principles, and could actually make the country less safe.

"If we ever abandon those values, we would not only make it a lot easier to radicalize people here and around the world, but we would have betrayed the very things we are trying to protect: the pluralism and the openness, our rule of law, our civil liberties, the very things that make our country great, the very things that make us exceptional," Obama said from the Treasury. "And then the terrorists would have won, and we cannot let that happen. I will not let that happen."

Saul Loeb | AFP | Getty Images

Barack Obama speaking June 14, 2016.

The president warned that terrorist groups like the Islamic State (also known as ISIS or ISIL) want to push the notion that "the West hates Muslims" as propaganda for recruitment. So, he argued, any U.S. actions that legitimize that notion are playing right into those groups' hands.

Later in the day, Trump told the Associated Press in an email that the president "claims to know our enemy, and yet he continues to prioritize our enemy over our allies, and for that matter, the American people."

He added that "when I am president, it will always be America first."

Among the many responses to the attack — during which a man armed with an assault rifle and pledging loyalty to the Islamic State group killed at least 49 people when he attacked a gay nightclub in Orlando, Florida — Trump renewed his call for immigration bans.

"The immigration laws of the United States give the president powers to suspend entry into the country of any class of persons," Trump said Monday. "I would use this power to protect the American people. When I'm elected, I will suspend immigration from areas of the world where there is a proven history of terrorism against the United States, Europe or our allies, until we fully understand how to end these threats."

"We cannot continue to allow thousands upon thousands of people to pour into our country, many of whom have the same thought process as this savage killer," he said, adding that "many of the principles of radical Islam are incompatible with Western values and institutions."

Obama said the flaw with Trump's proposal is that many recent mass murders — including the Orlando killer, one of the San Bernardino killers and the Fort Hood killer — were U.S. citizens.

"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?" Obama asked. "We've heard these suggestions during the course of this campaign. Do Republican officials actually agree with this?"