BBC: Islamic State militants could grow strong enough to target people on the streets of Britain unless action is taken, David Cameron has warned.
The PM, writing in the Sunday Telegraph, said a “humanitarian response” to IS was not enough and a “firm security response” was needed.
It comes as Church leaders expressed concern that the UK had no “coherent” approach to tackling Islamic extremism.
IS has seized large parts of northern Iraq and Syria over the summer.
Kurdish forces, supported by US air strikes, are currently battling to retake Mosul dam from IS fighters in northern Iraq.
There are also continuing reports of massacres of non-Muslims by the extreme Sunni group, which is seeking to build a new Islamic state spanning Iraq and Syria.
By Robin Brant, BBC political correspondent
The language is very strong – “a battle against a poisonous ideology” – and the warning is stark – “a terrorist state on the shores of the Mediterranean” – as the prime minister seeks to make the case for Britain returning to Iraq.
After a week that has seen UK military aircraft drop humanitarian aid, David Cameron makes it clear that alone is not enough to defeat IS. He talks repeatedly about Britain using its “military prowess” and military action, alongside diplomacy, to defeat the group.
The talk is tough, but Downing Street insists this is not an escalation. The Ministry of Defence has been reminding people that the UK has played no role in supporting the latest round of US air strikes on IS targets across northern Iraq.
The prime minister’s message is as much about home as well as abroad. People walking around with an Islamic State flag “will be arrested”, he says. That is a nod to the growing concern about Britons who have gone to fight jihad, in Syria or Iraq, returning home with the intention of carrying on the struggle.
Mr Cameron said: “True security will only be achieved if we use all our resources – aid, diplomacy, our military prowess – to help bring about a more stable world.
“If we do not act to stem the onslaught of this exceptionally dangerous terrorist movement, it will only grow stronger until it can target us on the streets of Britain.”
He warned that if IS was able to “carve out its so-called caliphate”, the UK would be “facing a terrorist state on the shores of the Mediterranean and bordering a Nato member”.
The UK has made aid drops to people stranded in northern Iraq but the prime minister warned a “broader political, diplomatic and security response” was needed, in addition to humanitarian action.
“We need a firm security response, whether that is military action to go after the terrorists, international co-operation on intelligence and counter-terrorism or uncompromising action against terrorists at home,” he wrote.
In Britain, the prime minister suggested, anyone “walking around with Isil flags or trying to recruit people to their terrorist cause” should be arrested.
Mr Cameron also made clear that he did not see this as a “war on terror” but as “a battle between Islam on the one hand and extremists who want to abuse Islam on the other”.
Speaking on Radio 5 live, communities minister Stephen Williams said any British citizen encouraging people to join IS should face “the full force of the law”.
Mr Cameron’s remarks come as the Bishop of Leeds warned “many” senior clergy in the Church of England were seriously concerned about Britain’s approach to the handling of the Iraq crisis.
The Right Rev Nicholas Baines has written to Mr Cameron asking about the government’s overall strategy in response to the humanitarian situation and to IS.
“Behind this question is the serious concern that we do not seem to have a coherent or comprehensive approach to Islamist extremism as it is developing across the globe,” he wrote, in a letter published on his website and backed by the Archbishop of Canterbury.
He criticised an “increasing silence” about the plight of tens of thousands of persecuted Christians in Iraq, and questioned whether they would be offered asylum in the UK.
Speaking to Radio 4’s Sunday programme, the Bishop of Manchester, the Right Rev David Walker, said the government had a “moral obligation that it is repeatedly failing to rise to”.
Meanwhile, Canon Andrew White of St George’s Anglican Church in Baghdad, and known as the vicar of Baghdad, warned the crisis could see the end of the Christianity in Iraq.
“They have had their family tortured and killed. They have had their homes taken and blown up, their churches removed and turned into State of Islam headquarters,” he told BBC Radio London.
“We as a community have got to be a prepared to give refuge to some of the Christian community from Iraq.”
It is estimated the group has up to 400 recruits from the UK, and some 69 people suspected of Syria-related jihadist activities have now been arrested in the UK.
In late June this year, IS declared that it had created a caliphate, or Islamic state, stretching from Aleppo in Syria to the province of Diyala in Iraq.
IS-led violence has so far driven an estimated 1.2 million Iraqis from their homes.
Whole communities of Yazidis and Christians have been forced to flee in the north, along with Shia Iraqis, whom IS do not regard as true Muslims.