"I believe we will be fighting this generational struggle for the rest of my political lifetime," Cameron said.
"We face in Isil (IS) a new threat that is single-minded, determined and unflinching in pursuit of its objectives," Cameron wrote in the Sunday Telegraph.
"We are in the middle of a generational struggle against a poisonous and extremist ideology," Cameron said, adding that Islamic State fighters sweeping across Syria and Iraq are a direct threat to the UK.
Cameron also expressed his concern over the Islamic State terrorist movement, saying "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."
More From This Section
However, he said he did not think British troops should be deployed in Iraq and he would consider working with Iran to combat the threat.
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.
In late June this year, IS declared that it had created an 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.