Islamic State fighters sweeping across Syria and Iraq are a direct threat to Britain and the country must use all of its "military prowess" to halt their advance, Prime Minister David Cameron said on Sunday.
But the Conservative Party leader said he did not think British troops should be deployed in Iraq, and that he would consider working with Iran to combat the jihadist threat.
Writing in the Sunday Telegraph, Cameron warned that the West faces a "generational struggle".
"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 said.
"I agree that we should avoid sending armies to fight or occupy, but we need to recognise that the brighter future we long for requires a long-term plan."
Cameron argued that security could only be achieved "if we use all our resources -- aid, diplomacy, our military prowess."
He also said Britain needed to work with countries like Saudi Arabia and Qatar, Egypt, Turkey "and perhaps even with Iran".
A high-ranking Anglican bishop on Sunday slammed Cameron's Middle East policy in a letter that had the backing of Archbishop of Canterbury Justin Welby.
"We do not seem to have a coherent or comprehensive approach to Islamic extremism as it is developing across the globe," the bishop of Leeds, Nicholas Baines, wrote in the letter, sent to the Observer newspaper.
Defence Minister Michael Fallon said on Saturday that Britain would keep up its surveillance flights over northern Iraq to try to stop more minority groups coming under jihadist attack.
Britain deployed Tornado fighter jets to Akrotiri earlier this month, which will now be joined by the Royal Air Force's most modern surveillance aircraft, the Boeing RC-135 Rivet Joint.
Kurdish forces backed by US warplanes battled on Saturday to retake Iraq's largest dam from jihadist fighters, a day after militants carried out a "massacre" of dozens of villagers.
Two months of violence have brought Iraq to the brink of breakup, and world powers relieved by the exit of long-time premier Nuri al-Maliki were sending aid to the displaced and arms to the Kurds.
Kurdish forces attacked the Islamic State (IS) fighters who wrested the Mosul dam from them a week earlier, a general told AFP.