The Islamic State of Iraq and the Levant (ISIS) faces growing challenges in its attempt to create a Islamic caliphate but political failures in Iraq threaten to create another Syria, says US security analyst Anthony Cordesman.
ISIS is now fighting on two fronts. It is making major gains in northern and western Iraq, and trying to take over a far larger portion of the rebel-held areas in Syria at the same time.
Its stated goal is to create a broader Islamic caliphate, but it already faces serious challenges in Syria from the al-Nusra Front and other rebel forces, and it has not shown it can make serious gains against President Bashar al-Assad's Hezbollah- and Iranian-backed forces.
It is also far from clear that Syrian urban and moderate Sunnis would ever accept ISIS rule, much less Alawites, or that Iran and Hezbollah would not further reinforce President Assad if ISIS really threatened to take Syria's major population centres.
Moreover, ISIS can never get US or European support, or official support from key Gulf states like Saudi Arabia, the United Arab Emirates or Kuwait.
ISIS will also face growing challenges the moment it moves on Baghdad and Iraq's Shia south or against the Kurds.
It would threaten a key oil exporter, directly challenge Iran, and challenge the key southern Gulf states, possibly uniting states that otherwise are de facto enemies. Oil is simply too important to let ISIS seize all of Iraq, although creating any kind of unified front or rapid effective resistance to this level of ISIS gains does not seem likely.
What could be far more difficult, however, is preventing ISIS from creating at least a temporary enclave in western and northern Iraq and some parts of eastern and north-eastern Syria.
Anger and resentment
Part of Syria is already a power vacuum that President Assad seems willing to let fester and contain, at least until he can control all of Syria's major cities and the centre of the country.
As for Iraq, Prime Minister Nouri Maliki has been a divisive, ineffective authoritarian disaster.
ISIS did not really defeat the Iraqi security forces in Falluja, Ramadi, or Mosul. It instead exploited a level of Sunni anger and resentment that has grown steadily with each act of repression and growing authoritarianism since the 2010 election.
Mr Maliki's suppression of peaceful protests, attacks on key Sunni political figures, failures to share the nation's oil wealth, and alleged corruption all combined to recreate Sunni anger and support for armed resistance, as did the failure to hire the former Sons of Iraq - Sunni militias working with the US - and show respect for Sunni tribal leaders.
The police and army were allowed to sell positions and promotions while commanders were by-passed and Maliki loyalists given key roles.
Corruption grew in the use of funds by the prime minister's office - a prime minister that tried to be the minister of both defence and the interior while steadily manipulating the justice system.
This led to rising violence and casualties in 2011 and 2012, and a serious shift back towards civil war in 2013, long before ISIS first attacked Falluja and Ramadi in late 2013.
The US-trained force lost unity, morale, leadership, and effectiveness. Good officers left or were pushed out or sidelined.
Unit cohesion dropped steadily, service support became a major problem, desertions and ghost soldiers increased, and sectarian tension grew.
The police deteriorated steadily and mixed corruption and abuses with a tendency to retreat to their stations whenever serious resistance occurred.
Mr Maliki became his own worst enemy, ignoring warnings from US advisers, dealing with Iran, and steadily losing confidence from Arab states while alienating the Iraqi Kurds.
His forces, which could not deal with urban warfare, tried to shell or bomb their way to victory, deserted under pressure, and found themselves under constant threat from low level ISIS and Sunni tribal attacks.
Some Iraqi forces still fought, as was the case in Samarra, but much of the west and north turned against Mr Maliki in spite of the abuses and extremism of ISIS.
This explains the collapse of the Iraqi force around Mosul, as well as the mass desertions and abandoned equipment and the other advances taking place, which now include Iraq's largest refinery.
It also raises serious questions about whether Iraq can move forward as long as Mr Maliki remains its leader.
He may still be able to bribe some key Sunni tribal leaders, and ISIS may soon alienate many Sunnis in the areas it occupies, but Mr Maliki has emerged as something approaching the Shia equivalent of Saddam Hussein, and is as much a threat to Iraq as ISIS.
Iraq desperately needs a truly national leader and one who puts the nation above himself.
Without one, ISIS may become a lasting enclave and regional threat - dividing Iraq into Shia, Sunni, and Kurdish sections - or drag Iraq back to the worst days of its civil war and create another Syria in Iraq.
Anthony Cordesman holds the Arleigh A Burke chair in Strategy at the Center for Strategic and International Studies in Washington.