David Petraeus is a retired U.S. Army general who commanded coalition forces in Iraq from 2007 to 2008 and Afghanistan from 2010 to 2011 and served as CIA director from 2011 to 2012. He is a partner in a major global investment firm.

In the next few months, a mixed force of Iraqi Arab and Kurdish security forces — including various Sunni and perhaps some Shiite militia elements — will enter Mosul, clear the city of Islamic State extremists and then work to bring governance, stability and reconstruction to one of Iraq’s most complex cities and its province.

There is no question that the Islamic State will be defeated in Mosul; the real question is what comes afterward. Can the post-Islamic State effort resolve the squabbling likely to arise over numerous issues and bring lasting stability to one of Iraq’s most diverse and challenging provinces? Failure to do so could lead to ISIS 3.0.

The prospect of the operation to clear Mosul brings to mind experiences from the spring of 2003, when the 101st Airborne Division, which I was privileged to command, entered a Mosul in considerable turmoil. Our first task, once a degree of order had been restored, was to determine how to establish governance. That entailed getting Iraqi partners to help run the city of nearly 2 million people and the rest of Nineveh Province — a very large area about which we knew very little.

Establishing a representative interim council to work with us in Nineveh proved to be no easy task — and its formation and subsequent developments hold insights for the coming endeavor in Mosul.

The challenge of Mosul and Nineveh is the considerable number of ethnic groups, religious sects, tribes and other elements that make up the province. Ultimately, we ensured that the provincial council included representatives of every district in Nineveh, of every major religion (Sunni, Shiite, Christian, Shabak), of each ethnic group (Arabs, Kurds, Yazidis, Turkmen), of every additional major societal element (Mosul University academics, businessmen, retired generals) and of each major tribe not already sufficiently represented.

We were able to structure a caucus that elected an interim provincial council. That council, in turn, elected an experienced, able interim governor (a Sunni Arab, given that Sunni Arabs made up the majority of Nineveh’s population), who was a well-respected, highly decorated former major general whose brother had been killed by Saddam Hussein and who had himself been under house arrest for a considerable period.

Importantly, I had the legal authority needed and the forces necessary to back up that authority, if required. I was not reluctant to exercise either.

U.S. forces today obviously lack the authority, remit and sheer numbers of the U.S. elements in Iraq in 2003. They also do not have the mandate that we had in the early days. But the enabling forces that the U.S.-led coalition has provided for Iraqi elements over the past year — intelligence, surveillance and reconnaissance assets, advisers, logistical elements, and precision strike platforms, in particular — have been instrumental in the successes enjoyed by the Iraqis in Ramadi, Fallujah, Tikrit, Baiji, Qayyarah and a host of other battle sites.

I have no doubt that coalition assets will, in the weeks ahead, do so much damage to the surviving Islamic State elements in Mosul that the battle there may well be less intense than many have feared. Thus, the most significant challenge in Mosul will not be to defeat the Islamic State; rather, it will be the task we faced there in 2003: to ensure post-conflict security, reconstruction and, above all, governance that is representative of and responsive to the people. All of this will have to be pursued largely by Iraqis, of different allegiances, without the kinds of forces, resources and authorities that we had.

Leaders of the various Iraqi elements will likely have their own militias, and there will be endless rounds of brinkmanship on the road to post-Islamic State boundaries, governing structures and distribution of power and resources. If those challenges are not enough, others will emanate from Iran and the Shiite militias it supports, from Turkey and Iraq’s Sunni Arab neighbors, from the Kurdish Regional Government that understandably wants to retain the disputed internal boundary areas that its peshmerga now largely control, and so on.

The effort in Mosul and Nineveh in the spring, summer and early fall of 2003 was very successful. Ultimately, however, it was undone by an inability to get Iraqi authorities in Baghdad to approve initiatives we pursued in reconciliation with former Baath Party members cast out of work by the Coalition Provisional Authority’s de-Baathification decree and in providing work for the tens of thousands of Iraq soldiers also rendered unemployed by the authority. The other ultimate challenge was the lack of clear direction and resources from Baghdad for their ministries’ activities in Nineveh. These failures meant that the Sunni insurgency ultimately intensified in Mosul, as it already had in the other Sunni Arab areas of Iraq. The Sunni Arabs in Nineveh came to see few reasons to support the new Iraq; indeed, they perceived many to actively or tacitly oppose it.

There clearly are lessons to be learned from our earlier experience — and from after the departure of U.S. forces in late 2011. Most particularly, they have to do with the need for inclusive, representative and responsive governance.

In the case of Mosul, Nineveh’s Sunni Arabs, in particular, will need considerable reassurances that their interests will be adequately represented in the new Mosul and Nineveh. But so will the Kurdish citizens of Nineveh (of multiple political parties), as well as Shiite Arabs, Shiite and Sunni Turkmen, Yazidis, Christians, Shabak and numerous tribes.

The best vehicle for carrying this out would be a provincial council like the one set up in 2003, and through a similarly inclusive process. Importantly, Shiite militias should play no role in post-Islamic State security and governance. Because Nineveh and the other Sunni Arab provinces lack significant energy resources and the leverage they provide, Kurdish-style constitutional autonomy is not a viable option. Nonetheless, Baghdad and Prime Minister Haider al-Abadi will need to be prepared to make more explicit commitments about levels of resourcing, and also perhaps grant the region greater autonomy in determining spending priorities. The task facing Abadi is exceedingly complex, but the only way forward is to squarely face the challenges, work to build relationships and press the many disparate parties to find common ground on the issues — aided by the U.S.-led coalition.

The process to resolve post-Islamic State issues will be difficult and intense. But having enabled the defeat of the Islamic State and having provided the largest amount of assets to ensure further successes and reconstruction initiatives, the United States, together with its numerous coalition partners, will have considerable influence over the resolution of the issues. It will have to exercise that influence.