The liberation of Mosul - the Islamic State in Iraq and Syria's (ISIS) de facto capital in Iraq - marks a turning point in the war against the world's most dangerous terrorist group.
Daesh, as ISIS is known throughout the Middle East, no longer controls significant territory in Iraq where it can harbour foreign fighters or exploit resources, like oil.
And its core narrative - building an actual state - is in tatters. But while the Trump administration will be right to celebrate the end of the caliphate as we know it, it is far too soon to feel comfortable, especially in the absence of a strategy for the day after Daesh.
Fifteen years ago, at the start of President George W. Bush's run-up to the invasion of Iraq, then Senators Joe Biden and Richard Lugar raised a prescient concern: "When Saddam Hussein is gone, what would be our responsibilities? This question has not been explored but may prove to be the most critical."
Substitute "ISIS" for "Saddam Hussein" and the question they posed retains a fierce urgency today. Even when ISIS is defeated militarily, the political and economic conditions that facilitated its rise - unleashed in part by the 2003 invasion - will continue to fester.
How, then, to ensure that Daesh stays defeated?
Most urgent is a fully resourced effort to stabilise, secure, govern and rebuild liberated cities so that displaced people can come home safely.
The good news is that a coalition of 68 countries led by the United States to fight ISIS has raised the necessary funds to start that process through the United Nations. A similar plan exists for Syria.
The United States can't dictate outcomes to a sovereign Iraq. But it can support, incentivise and mobilise those willing to move Iraq in the right direction. This starts with backing what Iraqi Prime Minister Haider al-Abadi calls functioning federalism - giving Iraqis at the provincial level the responsibility and resources to provide for their own security, services and schools and to govern their day-to-day lives. That's the best way to convince Sunnis that their future is within Iraq and not with a new ISIS.
But the ongoing civil war there will make it challenging to implement, as evidenced by the slow process of bringing the city of Tabqa - liberated two months ago and a gateway to ISIS' Syrian capital in Raqqa - back to life.
Even more challenging is what comes next. Twenty-five million Sunni Muslims live between Baghdad and Damascus. They have been alienated from their governments. Unless they can be convinced that their state will protect and not persecute them, an ISIS 2.0 will find plenty of new recruits and supporters.
Iraq offers the best prospects for success. But left to their own devices, its leaders are more likely to perpetuate the conditions that gave rise to violent extremism. And Iraq's neighbours will line up behind whichever sect they support, reinforcing a zero-sum mentality in Iraq itself.
That's where American diplomacy comes in.
The United States can't dictate outcomes to a sovereign Iraq. But it can support, incentivise and mobilise those willing to move Iraq in the right direction.
This starts with backing what Iraqi Prime Minister Haider al-Abadi calls functioning federalism - giving Iraqis at the provincial level the responsibility and resources to provide for their own security, services and schools and to govern their day-to-day lives.
That's the best way to convince Sunnis that their future is within Iraq and not with a new ISIS.
Iraq's Sunnis used to oppose federalism in favour of a strong central government; increasingly, they embrace it.
Iraq's Constitution provides for decentralisation, but it has yet to be put into effect. Some within the Shi'ite community, goaded on by Iran, will insist on retaining the spoils of majoritarian rule, preserving a dominant Baghdad to lord it over the Sunnis.
Bringing functioning federalism to life begins with effectively implementing a law that governs Iraq's militia, known as the Popular Mobilisation Forces (PMF).
Shi'ite PMF units must be placed under state control, kept out of politics and away from Sunni areas.
Sunni PMF units mobilised into the fight against ISIS need to stay on the state payroll and assume responsibility for securing their own territory. Baghdad also must make sure that investment and major infrastructure projects don't bypass Sunni regions.
At the same time, the Trump administration should use the strong relations it has built with Iraq's Sunni Arab neighbours to press them to engage Baghdad and advance Iraq's regional integration, while moderating the Sunni community's ambitions.
Their absence from Iraq has left a vacuum for Iran to fill. Their unconditional support for every Sunni demand feeds the sectarianism that further empowers Iran with Baghdad and risks tearing Iraq apart.
Kurdish ambitions pose an equally volatile challenge to Iraq's stability. The Kurdish region's leader, Mr Massoud Barzani, has called for a referendum on independence in September.
Meanwhile, the Kurds have taken advantage of the fight against ISIS to seize control of 70 per cent of the territories in northern Iraq that are in dispute between Arabs and Kurds, and which they won't be inclined to give up. Kurdish independence is a powerful dream and Mr Barzani sees its realisation as the heart of his legacy.
But moving too fast will incur the wrath of both Baghdad and the Sunnis, not to mention Turkey and Iran. If oil prices stay low, the Kurds will be hard pressed to become self-sufficient.
Here, too, the United States should resume its role as an honest broker. There's a deal to be made that gives the Kurds greater control over the oil in their region, while keeping federal troops out and negotiating joint responsibility for the disputed and oil-rich city of Kirkuk. It won't happen by itself.
One final question: What, if any, US military presence should remain in Iraq to help make sure ISIS does not rise again?
America's departure at the end of 2011 reflected the reality then, that most Iraqis simply wanted us gone. Now, as Iraq awakes from the Daesh nightmare, there may be greater appetite to keep some Americans around to train and enable Iraqi forces, and to provide intelligence and counter-terrorism support - but not to engage in combat.
How the Trump administration navigates this political minefield will be another crucial test of its strategy.
- The writer, a managing director of the Penn Biden Centre for Diplomacy and Global Engagement, was a deputy secretary of state in the Obama administration.