The invasion of Iraq by British and American forces was a "strategic error" which resulted in the crisis now threatening to tear the country apart, the former head of the armed forces has said.
General Lord Richards of Herstmonceux, who was chief of the defence staff until last year, also criticised Western efforts to intervene in Syria, saying they had been just enough to keep the civil war alive without actually resolving the conflict, allowing it to spread into Iraq.
He warned that more action was needed to prevent the latest unrest in the region radicalising a new generation of young Muslims in the UK.
In an interview with Sky News, Lord Richards said that the rise of the extremist Islamic State of Iraq and the Levant (Isis) was a direct consequence of the invasion of Iraq in 2003.
"My own personal view is that the invasion in 2003 was a strategic error. That is said with the benefit of hindsight. There's no doubt Saddam Hussein was a very brutal dictator but what it did was liberate a whole load of other forces and we're seeing that play through today," he said.
He said that the crisis in Iraq had been exacerbated by Western attempts to back the moderate opposition forces in Syria without providing the decisive assistance they needed to prevail against President Bashar al-Assad.
"If you're going to act to help a cause in another country, my strong view is you have to do it properly. What we did in Syria collectively was enough to keep the war alive but not enough to solve it so it's now spread into Iraq," he said.
Wile Lord Richards said that he did not believe that Isis was strong enough to take Baghdad, he admitted that the Iraqi army - trained by the British and the Americans - had performed badly and needed more assistance.
"I'm sad to say, the Iraqi army right now is in a state of shock. and needs a lot of help at the top level - what we would call command and control - to start getting a grip of things," he said.
He warned also that events currently taking place in Iraq could be repeated in Afghanistan following the withdrawal of international forces later this year, unless the government in Kabul was given the support it needed.
"For me it's a wake-up call that if we don't just honour our commitments to the people of Afghanistan made in very good faith ... I fear what we are seeing in Syria and Iraq could happen in Afghanistan next year and the thing we should be focusing on now is containing this," he said.
Lord Richards also called for "positive action" to ensure that more young Muslims in the UK did not become radicalised by events playing out in Iraq and Syria.
"The real key in many ways to prevent firing up our own domestic population is to make sure things going on in other parts of the world don't become flag bearers for just a few people to start causing trouble here," he said.
"If we don't deal with it there is a threat here which could grow. It could get bigger. So you need to snuff out a problem like this at the source, not just put up the barriers as they come back into this country."
Prime Minister David Cameron's official spokesman told a Westminster news briefing: "We are of course giving the Afghan army more training. That is why, for example, the UK has been establishing an officer training academy in Afghanistan.
"It is very important that the Afghan national security forces have their capabilities built up. That process has been going on for some time."