President Obama on Sunday urged tolerance and unity in the face of radical Islam, saying that the two people behind the shootings in San Bernardino, Calif., last week had embraced a “perverted interpretation of Islam.”

“We cannot turn against one another by letting this fight be defined as a war between America and Islam. That, too, is what groups like ISIL want,” he said, using an acronym for the Islamic State terrorist group. “ISIL does not speak for Islam,” he said. “They are thugs and killers, part of a cult of death.”

Obama spoke of the need for tolerance, emphasizing that “millions of patriotic Muslim Americans” reject the ideology of radical terrorists.

“Moreover, the vast majority of terrorist victims around the world are Muslim,” he said. “We must enlist Muslim communities as some of our strongest allies, rather than pushing them away through suspicion and hate.”

Obama said that the United States is cooperating with Muslim-majority countries and with Muslim communities in the United States to counter the vicious ideology that ISIL promotes online. Working with American Muslims, he said, does not “mean denying the fact that an extremist ideology has spread within some Muslim communities. It’s a real problem that Muslims must confront without excuse.”

The role of Muslim Americans denouncing groups such as the Islamic State has been controversial among some Muslim leaders. Some believe that by denouncing every attack, it becomes guilt by association.

Today, hundreds of Shia Muslims held an antiterrorism rally in Washington. And a group of Muslims raised about $53,000 for San Bernardino victims.

Obama’s remarks come just a few days after Attorney General Loretta Lynch offered support to a group of Muslim Americans, reportedly saying that she will fight for their rights to “expand and build mosques” and adding that “the Department of Justice is there for you.”

Obama said the United States must reject religious tests on whom it admits into the country.

“It’s our responsibility to reject proposals that Muslim Americans should somehow be treated differently,” he said. “Because when we travel down that road, we lose. That kind of divisiveness, that betrayal of our values plays into the hands of groups like ISIL.”

But as The Washington Post’s Michelle Boorstein wrote:

In fact, the role of religion in how refugees are considered and how the United States looks at persecution is more complicated. Religion is considered by both the United Nations and the State Department, which defines a refugee as “someone who has fled from his or her home country and cannot return because he or she has a well-founded fear of persecution based on religion, race, nationality, political opinion or membership in a particular social group.”

Southern Baptist leader Russell Moore initially said Obama’s speech was good because it identified last week’s attacks as terrorism. But he objected to Obama’s remarks about a religious test for refugees.

Although many Muslim Americans praised the president’s speech, some expressed dissatisfaction on social media.

Dawud Walid, a Muslim activist with the Council on American-Islamic Relations-Michigan, gave Obama’s speech a C-plus in a comment on Facebook:

“He talked about terrorism as if it is a Muslim only thing. He spoke as if Muslim leaders haven’t always condemned terrorism,” Walid wrote. “His statement about citizens not being able to buy guns on the no-fly list is problematic in terms of lack of due process, plus raising that point had nothing to do with San Bernadino.”

Want more stories about faith? Follow Acts of Faith on Twitter or sign up for our newsletter.

In the paid family leave debate, pro-life, pro-family groups’ own policies are all over the map

5 Myths about Rosa Parks, the woman who had almost a ‘biblical quality’

The amazing story of U.S. Army chaplains who ministered to Nazi leaders at the Nuremberg trials 70 years ago