Image copyright Getty Images Image caption Trump's remarks "bolster" the narrative of IS, the Pentagon says

Donald Trump's anti-Muslim rhetoric undermines US national security by boosting the Islamic State (IS) group, the Pentagon has warned.

The leading Republican presidential candidate has said Muslims should be banned from entering the US, in the wake of the deadly California attacks.

But Pentagon press secretary Peter Cook said such talk "bolsters Isil's narrative", referring to IS.

There has been a global outcry since Mr Trump made his remarks.

US Secretary of State John Kerry joined the onslaught of condemnation on Tuesday afternoon when he said they were "not constructive" in the fight against IS.

The IS militants are the target of a US-led bombing campaign in Syria and Iraq.

Mr Trump announced his plan days after an attack in California raised US fears about homegrown terrorism.

Image copyright AP Image caption Makeshift memorials mark the tragedy in San Bernardino

A Muslim couple, believed to have been radicalised, opened fire and killed 14 people at a health centre in San Bernardino.

One of the two perpetrators, Tashfeen Malik, reportedly pledged allegiance to Islamic State on the day of the tragedy.

But responding to Mr Trump's remarks, the US Pentagon said a border closed to Muslims would harm American efforts to counter extremist ideology.

Without mentioning Mr Trump by name, Mr Cook said: "Anything that bolsters Isil's narrative and pits the United States against the Muslim faith is certainly not only contrary to our values but contrary to our national security."

Analysis - Anthony Zurcher, BBC News, Washington

With Mr Trump's latest rhetorical flourish, Republicans can likely "write off" the support of Muslim US citizens.

And his ongoing diatribes against immigration from Latin America aren't going to win the hearts of Hispanics, either.

Even if he doesn't capture the nomination, he's pulled his party to the anti-immigrant, nativist right and forced his fellow candidates to take positions that could be harmful when the general election comes around next November.

In perhaps the greatest irony, Mr Trump is waging his war with the Republican establishment and the US media with tools that the conservative movement fashioned and had previously used with gusto.

Is Donald Trump destroying the Republican Party?

The Pentagon's view echoed a tweet from Hillary Clinton that said Mr Trump's proposed ban is "not only counter to our values - it plays right into the hands of terrorists".

The outcry was swift as soon as Mr Trump said in a statement on Monday night that Muslims nursed a "hatred" towards America and should be banned "until our country's representatives can figure out what is going on".

The property billionaire and reality TV star later said it would not apply to people living in the US.

He defended the idea on Tuesday, comparing it to policies implemented by President Franklin Roosevelt during World War Two against Japanese, German and Italian people in the US.

Media playback is unsupported on your device Media caption Donald Trump speaking to Barbara Walters on ABC World News Tonight: ''Somebody in this country has to say what's right''

But Muslim leaders, the UN and foreign leaders have criticised the call as dangerous and divisive, while the White House said Mr Trump should be disqualified from the race.

Attempting to explain his comments, Mr Trump said parts of London were "so radicalised the police are afraid for their lives".

London Mayor Boris Johnson said that was "ridiculous" and added: "The only reason I wouldn't go to some parts of New York is the real risk of meeting Donald Trump."

UK Prime Minister David Cameron said Mr Trump's comments were "divisive, unhelpful and quite simply wrong".

Republican leaders were strong in their condemnation. House Speaker Paul Ryan said: "What was proposed yesterday is not what this party stands for. And more importantly, it's not what this country stands for."

More on this story

Trump's 'highly respected' pollsters- Who are they?

Tough talk- Katty Kay on why his rhetoric wins

Free speech v hate speech - Would Trump get in trouble in Europe?

'Will the camps have wifi?' - Trump's proposal met with humour online

Police 'afraid' in 'radicalised' London- Trump claims officers "are afraid for their lives"

Degree disagreement - calls to strip Trump of honorary Scottish degree

Most of Mr Trump's rival Republican candidates were equally forthright.

But Ted Cruz praised the frontrunner "for standing up and focusing America's attention on the need to secure our borders", although he said he disagreed with the policy.

It is not the first time Mr Trump has come under fire for anti-Muslim remarks.

After the terror attacks in Paris, he suggested they register on a database and he said the US should refuse all Syrian refugees.