WASHINGTON (Reuters) - Harsh rhetoric about Muslims by Republican candidates in the U.S. presidential election campaign is undermining national security efforts, U.S. Homeland Security Secretary Jeh Johnson said on Tuesday.

Republican U.S. presidential candidate Donald Trump listens to rival Ted Cruz (R) during the Republican candidates debate sponsored by CNN at the University of Miami in Miami, Florida, March 10, 2016. REUTERS/Carlo Allegri

Asked about comments by Republicans Donald Trump and Ted Cruz, Johnson told MSNBC in an interview that singling out a specific community hampers government efforts to build the connections needed to thwart possible attacks.

“Inflammatory comments about patrolling and securing Muslim neighbors or barring Muslims from entering this country, having an immigration policy based on religion, is counterproductive to our homeland security and national security interests,” he said.

Johnson’s remarks come in the wake of attacks last week in Belgium claimed by Islamic State militants that have stoked security fears across Europe and the West.

U.S. officials have said there is no immediate known threat to the United States and have vowed to work with European authorities following those attacks, which targeted the Brussels airport and a subway station and killed at least 35 people.

Heightened concern over security has rippled through the nomination race for the Nov. 8 presidential election.

Cruz, a U.S. senator from Texas, called for police to patrol American Muslim neighborhoods following the Brussels bombings. Billionaire businessman Trump has continued his call for a temporary ban on Muslims entering the United States.

The rhetoric has polarized the U.S. electorate and prompted criticism, particularly from Democrats, including President Barack Obama.

Ohio Governor John Kasich, who is running a distant third in the Republican race for the nomination, on Tuesday blasted both of his rivals’ comments on security and said there should be more of a focus on intelligence-gathering and global cooperation, especially with help from Muslim communities.

“It’s so absurd,” Kasich said at a campaign event.

Johnson said officials have worked hard to connect with American Muslim communities to garner their assistance with U.S. national security efforts.”In this phase, it is critical that we build bridges to American-Muslim communities, not vilify them, not drive them into the shadows, and encourage them to work with us,” he said.

Democratic presidential candidate Hillary Clinton, a former U.S. secretary of state, has urged the United States and Europe to do more to defeat Islamic State and has slammed Cruz and Trump’s rhetoric toward Muslims.

U.S. Senator Bernie Sanders of Vermont, Clinton’s rival for the Democratic nomination, has also said he opposes surveillance of Muslim communities but backs stronger intelligence-sharing and monitoring of social media in the fight against Islamist militants.