The shooting was still going on down by the river two weeks ago when Iraq’s Prime Minister Haider al-Abadi dropped by and prematurely declared that the battle for Mosul was over. He was misled by the various Iraqi army, police and militia units who were competing with one another to declare victory first. But now it really is over — and there is little left of Mosul.

The siege began Oct. 17 of last year, so it lasted nine months — longer than the Battle of Stalingrad. It probably killed more civilians, too, because the U.S.-led air forces were used to compensate for the shortage of trained and motivated Iraqi ground forces.

Individual Islamic State snipers were regularly taken out by airstrikes that leveled entire buildings. Life is returning to some of the east-bank suburbs that were retaken last year, but there is nothing to go back to in the oldest part of the city on the west bank, where Islamic State made its last stand. And the level of destruction has been almost as high in a lot of other cities.

The Sunni Arab communities of Iraq and Syria are shattered and scattered. The mixed Sunni-Shiite neighborhoods of Baghdad were mostly “cleansed” of their Sunni residents in the civil war of 2006-2008. Even Sunni-majority cities in Iraq that were taken back from Islamic State a couple of years ago, like Ramadi and Fallujah, are still largely deserted, with few signs of reconstruction.

Not many of the estimated 900,000 people in refugee camps around Mosul, almost all Sunni Arabs, will be going home soon, either. And in Syria, the eastern side of Aleppo, Syria’s biggest city, fell last December after a four-year siege. It now contains a few tens of thousands of people rattling around in the ruins.

Raqqa, Islamic State’s capital in Syria, will be largely destroyed in the next few months, and after that it will be the turn of Deir-es-Zor. The calamity that began in 2003, when the U.S. invasion of Iraq overthrew the centuries-long Sunni rule over a mostly Shiite country, has reached its final phase.

There can be no comeback for the Sunni Arabs of Iraq, who only make up one-fifth of the country’s 36 million people. They have been ruined by their long complicity with Sunni minority rule of the country, first under the Turkish empire, later under Sunni tyrants like Saddam Hussein, and finally by their reluctant, desperate support for Islamic State. Some, maybe most, will remain in the country, but not as equal citizens.

The Sunni Arabs of Syria will not suffer the same fate, for they are fully 60 percent of that country’s population, but their current situation is appalling. They were very unwise to throw their lot in with Islamic State and al-Qaida — which most of the Sunni fighters in Syria did in the end, though it is impolitic to say so in public — and they are now paying a heavy price for that mistake.

There’s at least another year’s fighting against Islamic State and al-Qaida-linked forces in Syria before reconciliation can even begin. There may be much more than a year’s fighting before the Kurds are subjugated again in Syria and Turkey.

They are out of the box now, controlling almost all of the Kurdish-majority parts of northern Syria and many rural areas in southeastern Turkey. Since Turkey’s President Recep Tayyip Erdogan re-started the war against Turkey’s Kurds two years ago, they have even taken control of some parts of the Kurdish-majority big cities in the southeast — and bits of them look like Syria’s devastated cities.

As for Iraq’s Kurds, it may prove impossible to put them back in the box at all. Thanks to the collapse of the Iraqi army three years ago, when Islamic State overran much of the country in a fortnight, the Kurdish Regional Government now rules over all the traditionally Kurdish areas of Iraq. It is effectively an independent country, and it has scheduled a referendum for September to make that official.

Iraq’s government will fight that, of course, but unless the United States is willing to bomb the Kurds the way it bombed Islamic State, Baghdad is unlikely to win. The Iraqi army couldn’t even have retaken Mosul without the lavish use of U.S. air power.

So there’s lots of fighting left to be done and lots of opportunities yet for the United States and Russia to stumble into a confrontation. Stay tuned.

Gwynne Dyer is an independent journalist whose articles are published in 45 countries.