Peter Bergen is CNN's national security analyst, a vice president at New America and a professor of practice at Arizona State University. He is the author of " United States of Jihad: Investigating America's Homegrown Terrorists ."

Sulaimani, Iraq (CNN) In a tea room in Sulaimani's old bazaar that's dense with the smoke of scores of cigarettes, bunches of grizzled, middle-aged men -- some wearing traditional Kurdish baggy trousers, other wearing suits without ties -- are arguing furiously about the great question of the day:

What happens to Iraq after ISIS loses the key Iraqi city of Mosul?

For the moment, the Iraqi army, Kurdish peshmerga forces, Shia militias and Sunni tribal units are all united in fighting ISIS. But even in Sulaimani, an Iraqi-Kurdish city close to the border with Iran that is one of the most stable corners of a very unstable Middle East, there is considerable worry about what comes next. As a senior Iraqi government official put it to me: "This is the $64,000 question."

Mosul, the second largest city in Iraq, is where almost three years ago ISIS declared its self-styled caliphate.

This month Iraqi forces seized Mosul's main government building and central bank from ISIS militants and they are now closing in on the historic Al Nuri mosque where ISIS leader, Abu Bakr al Baghdadi, first declared himself to be caliph, an astonishing claim asserting that Baghdadi was not only the leader of ISIS, but also the leader of all Muslims around the world.

Baghdadi's caliphate has proven relatively short-lived. ISIS has lost more than half of the territory that it once held in Iraq. Iraqi soldiers liberated eastern Mosul weeks ago and they are now working their way through western Mosul, on the other side of the Tigris River, which bisects the city.

The final push to dislodge ISIS from Mosul is a tough fight. Western Mosul is the historic heart of one of the oldest cities in the world. Its narrow streets and alleyways are impassable for armored vehicles. Most of the ISIS fighters who remain in Mosul are willing to fight to the death and ISIS has deployed a large number of suicide bombers and even armed drones to disrupt the Iraqi military advance. Already ISIS has launched a furious counter attack to reclaim the main government building in Mosul.

Several hundred thousand civilians are hunkered down in their homes in western Mosul, with half of them at risk of being displaced by the fighting, according to Lise Grande, the U.N. humanitarian coordinator for Iraq. Grande told a conference in Sulaimani earlier this month, "We cannot rule out the risk of a prolonged siege" in western Mosul.

But after the sobering task of driving ISIS from Mosul is completed, an even more challenging question remains: Can Iraq remain in one piece?

Fears about anti-ISIS alliance dissolving

On Monday Iraqi Prime Minster Haider al-Abadi met with President Donald Trump in Washington DC. That meeting came ahead of a conference in Washington later this week of the 68 countries that make up the anti-ISIS coalition. What comes after the defeat of ISIS in Iraq will surely be a key part of the discussions among the coalition.

In a country that has endured a brutal civil war at the height of which a decade ago 100 civilians were dying every day, there is understandable fear among Iraqis that once ISIS is largely defeated, the anti-ISIS alliance that includes Kurdish peshmerga forces, Shia militias and Sunni tribal units and which has held together Iraq's fractious ethnicities and sects will dissolve.

In order to avoid conflict between these various forces inside Mosul, a political agreement was hammered out before the Mosul operation began in October that allowed only the Iraqi army into the city and excluded the various Kurdish, Shia and Sunni militias that are also fighting ISIS. It is the elite special forces of Iraq's Counter Terrorism Service and, in particular, its Golden Division, that is doing the bulk of the fighting inside the city.

The United States is supporting the Iraqi military with a mix of Special Operations Forces, intelligence and close air support. That last category includes armed drones, manned aircraft and Apache helicopters.

But what comes after ISIS loses Mosul? Or to invoke General David Petraeus' famous question at the beginning of Iraq War in 2003: "Tell me how this ends?" Nearly a decade and half later, Petraeus' question is still a very good one, as there is still a great deal of uncertainty about the future of Iraq.

On the plus side of the ledger, the largely Shia government of Iraqi Prime Minister Abadi is, by Iraqi standards, a relatively stable government and Abadi himself is a moderate Shia politician, unlike his highly sectarian predecessor, Nouri al Maliki.

After Mosul falls

Balanced against that, a senior Iraqi government official told me, when Mosul falls, "There will be plenty of revenge killings outside of the media lens," adding that, "the government will not intervene." The official said that reconstruction of the heavily damaged city "will take a while" and reconciliation between the six ethnicities and sects that inhabit Mosul is going "to be tough." That's because in some cases half of a particular tribe was for ISIS and the other half was against it.

Also for many Kurds the success of the Kurdish peshmerga on the battlefield is more than a matter of ethnic pride. It may lead to the creation of "facts on the ground" that argue for the creation of the long-cherished dream of a Kurdish state.

The Kurds are one of the largest ethnic groups in the world without their own state. At least 25 million Kurds are spread across Iraq, Iran, Syria and also Turkey, which has a large Kurdish minority. The Turkish government will never tolerate the creation of a Kurdish state.

At the same time Sunnis, who make up the majority of Mosul's population, are leery of the Shia militias and the Shia-dominated Iraqi government, and if their interests are marginalized as they have been repeatedly in years past, they will throw their support -- or at least their acquiescence -- to any Sunni militia group that seems to be fighting for their interests, just as some did with ISIS and before that its parent group, Al Qaeda in Iraq.

Add to these factors the understanding that the fall of Mosul will do nothing, of course, to end the continuing civil war in neighboring Syria, which is where ISIS first made significant battlefield gains. What remains of ISIS's Iraqi branch after the fall of Mosul will likely regroup in Syria.

Compounding Iraq's problem is that its economy is highly dependent on oil. Oil prices have tanked in the past couple of years, as a result of which the World Bank assesses : "The Iraqi economy is facing severe and pressing challenges.... [and] a sharp deterioration of economic activity."

All of these factors are likely to cause continuing instability in much of Iraq.

Abadi meets Trump

Fortunately, Trump's new executive order to temporarily ban the travel from six Muslim-majority countries to the United States no longer includes Iraq, as the first version of the travel ban did. This made Monday's visit between Abadi and Trump a much warmer one than if the Iraq travel ban were still on the table.

The arbitrary nature of the Iraqi travel ban was underlined by the fact that Lt. Gen. Talib Shaghati, who is the most important leader in the anti-ISIS fight since he heads the Iraqi Counter Terrorism Service, could not get a visa to visit his own family members in the United States.

Follow CNN Opinion Join us on Twitter and Facebook

Now that Abadi has met Trump, he should invite him to visit Iraq and see a city such as Sulaimani which is, by regional standards, a safe and well-ordered city of smooth highways and modern apartment blocks ringed by snow-capped mountains that feels a lot freer and more open than much of the rest of the Middle East.

At the American University in Sulaimani, female students wear a wide range of garb, from simple headscarves to tight-fitting dresses paired with high heels. At the annual Suli Forum that was held at the American University this month, students didn't hesitate to pepper Lt. Gen. Shaghati, with pointed questions about the use of force against civilians, a level of free speech that is almost entirely absent in the rest of the region.

A little exposure to a city like Sulaimani will help Trump understand that the Middle East is a much more complex place than he seems to believe. Perhaps Trump could even give a speech at the American University in Sulaimani, just as President Obama did at Cairo University early in his first term. In the speech, Trump could celebrate the open society and free market that exists in Kurdistan and which are, of course, not only American values, but also the values of free peoples all over the world.

This article has been updated to reflect President Trump's meeting with Prime Minister Abadi.