Since the shock takeover of Mosul, the progress of ISIS through Iraq has been slowed and, in some places reversed. This has happened because further, Shia-dominated territory is more difficult for ISIS to conquer and because demoralised Iraqi forces are increasingly supported by Shia militias, often with Iranian organisational help, by Kurdish Peshmerga forces who are receiving assistance from the West, and by US air strikes.
The formation of a new government in Baghdad has raised hopes that a political solution to the violence could emerge, but even a broadly acceptable Iraqi government will have to deal with intractable problems including the failures of the armed forces, sharing of oil revenues, decentralisation demands and territorial disputes.
The UK and other Western governments have pledged to assist the Kurdish Peshmerga and the Iraqi government, and this is widely thought to comply with international law because the Iraqi government has requested assistance to deal with ISIS. However, any outside military action in Syria (which is thought to be necessary if ISIS is going to be tackled effectively) would be more difficult to justify. There are some who argue that as a humanitarian intervention it could be legal without a UN Security Council resolution; any such resolution would be likely to be vetoed by Russia.
Many commentators have argued that strong military intervention by the West in Iraq would be unlikely to be successful and might even be counter-productive; a solution involving regional powers such as Iran, Turkey and Saudi Arabia would be preferable. However the fundamental hostility between Sunnis and Shias which is likely to be exacerbated by both the Syrian and Iraqi conflicts, stands in the way of regional cooperation and is difficult to resolve.