Prime minister says Islamist fighters in Iraq will 'hit us at home' if Britain does not help stabilise regime

The crisis in Iraq must not be dismissed as "nothing to do with us" as the same Islamic jihadists are also planning to attack the UK, David Cameron has warned.

The prime minister said the terrorist insurgence in Iraq, as well as related problems in Somalia, Nigeria and Mali, would "come back and hit us at home" if the UK did not help stabilise these regimes.

Speaking in the House of Commons, he said the "hard attack" of direct intervention by the west was not the only option as that could create its own problems.

Cameron set out his argument after the Labour leader, Ed Miliband, pressed him to explain the government's response to the turmoil during prime minister's questions.

"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," he said.

"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. So the right answer is to be long term, hard-headed, patient and intelligent with the interventions that we make, and the most important intervention of all is to make sure that these governments are fully representative of the people who live in their countries, that they close down the ungoverned space, and they remove the support for the extremists.

"If we do that, not just in Syria, but we have to help in Iraq, in Somalia, in Nigeria, in Mali, because these problems will come back and hit us at home if we don't."

Cameron said the Iraqi government needed to take a more inclusive approach to the Shia, Sunni and Kurd populations who live in the country. He also announced a £2m increase in the humanitarian aid budget for Iraq, increasing it to £5m overall.

It comes before a meeting of the National Security Council, which the prime minister will chair, to discuss the crisis and the UK's restoration of diplomatic ties with Iran. These have been cut for more than two years since the UK embassy in Tehran was stormed by protesters in 2011. Miliband said Labour supported the decision to reopen the embassy, but warned that the Iranian regime had shown in the past that it did not support an inclusive and democratic state in Iraq. The prime minister said this would be done with a "very clear eye and a very hard head".

The Labour leader also urged the prime minister to speak to other countries in the region from Saudi Arabia to Qatar to make sure they were not fuelling the conflict.

The Iraqi government has reportedly blamed Saudi Arabia in particular for supporting the Islamic State in Iraq and the Levant (Isis) – the Sunni militia wreaking havoc in Iraq. Cameron said the UK would take a consistent approach to countries in the Middle East, saying it was possible to have a dialogue with a country that had destabilised the region while supporting the "voices of moderation, the voices that support democracy, inclusive government, pluralistic politics, under the rule of law".

He said he could reassure MPs that "our engagement with the Saudi Arabians, with Qataris, with Emiratis and others is all on the basis that none of us should be supporting those violent terrorists or extremists".

The exchange between Cameron and Miliband was unusually consensual for a debate at prime minister's question time as the two leaders struck a serious and measured tone.

The prime minister's remarks echoed Tony Blair's warning that the fresh crisis in Iraq "affects us all". However, Cameron did not repeat the former Labour prime minister's call for a military intervention, which has drawn outrage from opponents of the 2003 conflict.

Speaking on Monday, William Hague, the foreign secretary, said the turmoil in Iraq should not be used as an opportunity for a "proxy debate about Tony Blair and everything he has ever said and done".

However, Sir Peter Tapsell, the father of the house, used prime minister's question time to call for the House of Lords to begin a process of impeachment against Blair for misleading parliament about the reasons for going to war against Saddam Hussein. The process of impeachment was last used in 1806 and is now considered obsolete.