"I'd disagree with those people who think this is nothing to do with us and if they want to have some sort of extreme Islamist regime in the middle of Iraq that won't affect us -- it will," Cameron told the House of Commons.
"The people in that regime, as well as trying to take territory, are also planning to attack us here at home in the United Kingdom."
He was speaking before chairing a meeting of the government's National Security Council (NSC) on the militant offensive in Iraq, which is being spearheaded by jihadists from the Islamic State of Iraq and the Levant (ISIL).
The main concern is that British citizens fighting there may return to attack their homeland, and Cameron said today that Britain's security, intelligence, and policing resources were focused on the Middle East.
Also Read
Cameron told parliament: "The estimates are now that this is a greater threat to the UK than the return of foreign jihadists or fighters from the Afghanistan or Pakistan region."
He said that "we've already stopped a number of people travelling, we've taken away passports", although he did not give any further details.
After the controversies of Britain's participation in the US-led invasions of Iraq in 2003 and Afghanistan in 2001, there is little appetite for direct British military intervention to stop the militants in Syria and Iraq.
But Cameron said: "I think it would be a mistake to believe that the only answer to these problems is the hard attack of direct intervention."
What was needed was a "long-term, hard-headed, patient and intelligent" approach, focused around ensuring that governments in the region were "fully representative" and did not allow space or support for extremists, he said.