The House on Friday rejected a controversial proposal that would have required the Secretary of Defense to conduct a study of “Islamic religious doctrines, concepts or schools of thought” that could be used to radicalize or recruit Islamic terrorists.

The amendment offered by Rep. Trent Franks, R-Ariz., was defeated by a vote of 208-217. There were 27 Republicans who crossed the aisle to vote against the measure.

The amendment would have required Defense Secretary Jim Mattis to “conduct two concurrent strategic assessments of the use of violent or unorthodox Islamic religious doctrine to support extremist or terrorist messaging and justification" within a year.

The assessments would be used to identify the role Islamic religious doctrines play in radicalization and terrorist recruitment and how they “are incorporated into extremist or terrorist messaging.”

During Thursday night’s debate, Franks tried to counter allegations his idea was bigoted and anti-Muslim.

He told his fellow members that there is “no desire in my heart whatsoever to single out or denigrate” one religion, but, he noted, even countries in the Muslim world are examining the roots of Islamic extremism. He further added that the primary victims of terrorists are Muslims themselves.

Supporters say the studies are important to develop a coherent strategy to defeat radicalized groups from Nigeria’s Boko Haram to Abu Sayyaf in the Philippines.

Opponents, primarily on the Democratic side, charged it was blatantly targeted toward Muslims and constitutionally questionable.

Rep. Keith Ellison, D-Minn., argued it was not an effort to study terrorism but to restrict the free exercise of Muslim religious expression.

“Nobody is saying you can’t study terrorism,” Ellison, a Muslim, said Thursday evening on the House floor. “You can study what motivates people to commit acts of terrorism. And we should. But we don’t, not equally. The fact is, this amendment singled out one religious group. It’s wrong and it should be voted down.”

The ACLU argued in a letter distributed before the vote that Congress has “no role in assessing religious beliefs or practices and determining their validity, significance, or function” and that the First Amendment protects against such “abuse of governmental authority.”

Opponents also questioned who would lead the study.

Franks’ amendment called for the formation of a team of government experts who possess the “appropriate background and expertise” and another group with similar qualifications to be drawn from outside government.

“[President Trump’s] rhetoric has contributed to the growing movement of hate in our country, and I have no doubt that some of the most notorious racist, anti-Muslim voices will be a part of the non-government assessment demanded by this amendment,” the Minnesotan said in a statement.

The Council on American-Islamic Relations, a Muslim activist group, weighed in, questioning whether the Trump administration was capable of selecting unbiased government representatives.

“The prospect of Trump asking one of his notoriously Islamophobic advisors like Steve Bannon, Stephen Miller or Sebastian Gorka to provide such ‘expertise’ or to identify contributors to this assessment should frighten all Americans,” said CAIR Director of Government Affairs Robert McCaw in statement opposing the amendment.