The Islamic State's self-proclaimed caliphate, the brutal "state" the extremist group ruled for three years in Syria and Iraq, is rapidly collapsing.
After months of grueling combat, Iraqi troops have finally retaken Mosul, their country's second-largest city, at the cost of thousands of lives and the destruction of its ancient center. In neighboring Syria, Kurdish and Arab fighters with American advisers are closing in on Islamic State's capital of Raqqa.
The United States and its allies are winning the major battles. But they are still in danger of losing the war.
The fall of Mosul and Raqqa won't solve the problem that led to Islamic State's rise: the misrule of Sunni Muslim areas by governments in Baghdad and Damascus. It won't even eliminate the terrorist threat that Islamic State poses to the West. Instead, it'll open a vacuum — and if the Middle East has shown us anything over the past decade, it's that when there's a vacuum, bad things can happen.
In the short run, Islamic State still holds big chunks of territory in Syria and Iraq. The group has been displaced from its two biggest cities, and there are persistent reports that its leader, Abu Bakr Baghdadi, is dead. But the rest of its leadership has already moved the de facto headquarters from Raqqa to Deir Ezzor in eastern Syria.
Islamic State has been weakened, but it hasn't been destroyed. "There is still a tough fight ahead," the U.S. commander in the region, Lt. Gen. Stephen J. Townsend, warned last week.
Islamic State wasn't originally a caliphate. It began as an underground guerrilla group, Al Qaeda in Iraq. American and Iraqi forces almost destroyed the group, but it moved into Syria and evolved. The group's biggest mistake — almost unique among terrorist groups — was its brash declaration of statehood in a desert territory vulnerable to the U.S. Air Force.
Now it's evolving again, into what one terrorism expert calls "Islamic State 3.0." Many of its militants have scattered and returned to the earlier, traditional model: clandestine cells with no fixed territory. They're already carrying out small-scale attacks in Iraq and Syria — and they are probably still capable of launching attacks in Europe as well.
Many of the Trump administration's national security officials know that history painfully well, and firsthand. Defense Secretary James N. Mattis and national security adviser H.R. McMaster both commanded troops in Iraq.
"We've all seen the results of leaving ungoverned areas," Mattis said recently. "It's not like you can say, 'I'm going to quit.'"
Mattis and his aides have offered a plan — at least, the outline of a plan — to fill the governance vacuum in areas taken from Islamic State. It begins with a continued U.S. military presence. The chairman of the Joint Chiefs of Staff, Gen. Joseph F. Dunford Jr., has told Congress that he expects U.S. advisors to be in Iraq "for years to come."
In Iraq, the governance plan relies on Prime Minister Haider al-Abadi to step up efforts at reconciliation between the Shia Muslim majority and the Sunni Muslims who were Islamic State's base of support. But reconciliation hasn't taken hold yet; Abadi is being opposed by Nouri Maliki, the pro-Iranian former prime minister whose sectarian policies fueled Islamic State's rise.
In Syria, the problem is even more complicated. The United States is organizing local councils to try to govern areas that fall vacant when Islamic State withdraws. But there's a rival claimant to power: the Russia-backed government of Bashar Assad. "The most likely scenario is for the Assad regime to reassert its influence with help from Russia and Iran," Charles Lister, a Syria expert at the nonpartisan Middle East Institute, told me. That would merely lead to a new cycle of repression and rebellion.
Then there's the need for economic reconstruction, a multibillion dollar challenge in both countries. The United States wants wealthy Arab countries, including Saudi Arabia, to shoulder most of that burden, but the oil states haven't stepped up.
"There's no real money for reconstruction, from either the United States or our wealthy allies in the region," said Richard A. Clarke, a former counterterrorism adviser under Bill Clinton and George W. Bush. "Eventually, that will create conditions ideal for Islamic State or some other terrorist group to come back. It will be as though we built a terrorist breeding ground."
When Trump was campaigning last year, he claimed he had a secret plan to destroy Islamic State "very, very quickly." Instead, to his credit, he listened to Mattis and endorsed an intensified version of the strategy he inherited from President Obama.
But now, to make it stick, he's going to have to continue the military campaign — and add a better-funded diplomatic and reconstruction campaign, too. That won't be easy for a president who has proposed to slash spending on diplomacy and foreign aid by roughly 30%.
It will be tempting, for some, to celebrate the fall of Raqqa, declare the war over and pull out. But that's not how counter-terrorism works. The only way to end the threat from Islamic State — in whatever guise it adopts — is to stay in the fight a good deal longer.