Improvisation might seem like a smart idea given the vagaries of war. After all, you can’t script a military campaign. Conflicts are complex and fluid, especially against a metamorphosing enemy like the terrorist-insurgent-state that is ISIS. It’s tough to predict events next week, never mind next year. But thinking through the endgame is a critical part of any wartime strategy. The Prussian military theorist Carl von Clausewitz advised against taking the first step in war “without considering the last.” And former U.S. Secretary of State Henry Kissinger wrote, “The test of policy is how it ends, not how it begins.”

A short-term mentality can be catastrophic during war. In the fall of 1941, as Churchill and FDR sketched the postwar global architecture, Japanese officials debated whether to launch a surprise attack against the United States. Rather than consider what a prolonged campaign versus the most powerful country in the world might look like, Japanese Prime Minister Hideki Tojo urged a leap of faith. “There are times when we must have the courage to do extraordinary things—like jumping, with eyes closed, off the veranda of the Kiyomizu Temple,” he said, in reference to a Buddhist shrine in Kyoto that juts out over a steep cliff edge. Four years later, every major Japanese city had been reduced to ashes.

Similarly, in 2003, the United States invaded Iraq with little heed to the long-term consequences. The George W. Bush administration was focused on the proximate goal of toppling Saddam Hussein, and largely ignored the question of how to stabilize Iraq afterwards. Tommy Franks, the head of U.S. Central Command, captured this mentality by telling the deputy secretary of defense: “You pay attention to the day after, I’ll pay attention to the day of.” But none of the key players paid enough attention to the day after. There was no plan to win the peace, and U.S. soldiers were left to improvise desperately as Iraq collapsed.

What is the endgame in the war against ISIS?

First of all, suppressing or defeating ISIS is not the goal. Rather, the aim is to create a secure Iraq and Syria. War is not about destroying the enemy; it’s about building a better peace so that the threat doesn’t reemerge. There’s no point in toppling a regime if the result is chaos and anarchy, whether that regime is the Taliban in Kabul, Saddam in Baghdad, Qaddafi in Tripoli—or ISIS in Raqqa. You can’t march away from smoking ruins and call it a victory. After all, ISIS’s predecessor was seriously weakened during the U.S. troop surge in Iraq in 2007. But the insurgents made a comeback due to sectarianism and misrule in Baghdad.

Who, for example, will govern the territory captured from ISIS? You break the caliphate, you own the caliphate. Stabilizing Syria and Iraq is a truly daunting task. It may require a decade-long humanitarian and peacekeeping effort. The United States will need to play a key role in this endeavor, which will very likely involve a commitment of American ground troops. If ISIS is pushed out of key cities, the insurgents won’t sign surrender documents like Japan did in 1945. Instead, they’ll wage a brutal campaign of terrorism to reclaim the caliphate. Are those fighting ISIS prepared for a wave of suicide bombings, kidnappings, and torture? Is the international community ready to invest billions of dollars in humanitarian aid and economic development? How will the U.S. and its allies win over Sunni Muslims to their cause rather than ISIS’s?