The U.S.-backed Iraqi military won an important victory this month when it liberated the key city of Mosul. But the war is far from over. Iraq remains a deeply divided country at a crucial stage and with a precarious future.

It consistently ranks as one of the more corrupt countries in the world, and armed conflict between ISIS and an array of Iraqi forces continues. ISIS has lost a lot of territory, and Iraqi leaders have declared the end of the caliphate, but pockets of resistance remain scattered around the country.

Iraq is beset with sectarian and ethnic divisions, which present a formidable challenge to its stability and unity for its Shiite Muslim-led government, presided over by Prime Minister Haider al-Abadi.

Shiites make up about 60 percent of the population, many of them in the south. Sunnis are about 20 percent, concentrated in central Iraq. Ethnic Kurds, about 18 percent, are in the north. And there are divisions within the divisions, with local and religious leaders controlling their own militias and armed forces.

The minorities want more autonomy; many Kurds want their own state. Abadi has taken several helpful steps. He has drafted an ambitious reform package and brought Kurds and Sunnis into his cabinet. He has sought support from Ayatollah Sistani, the most revered religious figure in the country. He has appealed to the disenchanted Kurds, moved to rebuild a corrupt military, opened dialogue with estranged Arab neighbors and renewed ties with the United States.

Economic growth is key to Iraq's national security and well-being, but the government hasn't made nearly enough progress on that front. The economy is dominated by oil, which provides more than 90 percent of government revenue and 80 percent of foreign earnings. Iraq has had almost no success in diversifying. When oil prices decline, austerity follows, leading to a deterioration of services and popular unrest.

So, what can the United States do?

Nearly everyone agrees there can be no military solution. We have about 6,000 troops in Iraq, and we conduct airstrikes to support Iraqi forces. We do not want to allow ISIS safe havens from which it can plan attacks.

With U.S. help, the Iraqi military has won hard-fought battles and diminished the military and economic capacity of ISIS. But talk about a post-ISIS situation is premature. It's changing its tactics and still presents a difficult security challenge. The war continues to produce American casualties and drain American resources, with most estimates putting the cost at over $1 trillion and counting.

President Barack Obama seemed to conclude that military action in Iraq had produced few tangible policy gains. President Donald Trump appears more willing to use force, but it is not at all clear how far he will go or what he seeks to accomplish if he does. Knowing the American people are wary of foreign engagement, Trump provides few details.

Meanwhile, Iran has emerged as dominant in the struggle for influence in Iraq, heightening tensions around the region with the U.S. and with Saudi Arabia and other Sunni states.

We could ratchet up our current approach, supporting the Iraqi government and army while providing a great deal of military and economic aid. The international community remains skeptical about Iraq’s ability to manage resources or effectively utilize aid, however.

We could withdraw and leave the Iraqis to fend for themselves. That would effectively give the Iranians a free hand.

Another approach would be to create comprehensive military-economic-diplomatic strategy aimed at driving out ISIS, improving governance and bringing greater stability and post-war reconstruction to Iraq.

A long-term political solution will probably require some kind of loose confederation with a central government controlling the currency, distribution of oil revenues and border protection. But this has to be worked out internally. Washington may have once been able to impose a structure, but it can't now.

We could promote a regional settlement, which would have to include countries like Turkey, Syria and probably Iran, and would require investing significant diplomatic and political resources. It would also mean getting support from other outside parties such as the European Union, the United Kingdom, China and Russia. Trump’s severe budget reductions in diplomacy and aid would sharply limit what we could do under this approach.

So U.S. strategy is adrift. At the end of the day, neither we nor Russia nor anybody else can be the guarantor of stability for the Iraqi state. Real questions persist about whether Iraq can survive as a unified country.

But our current approach is to sweep the complexities under the rug and continue tolerating a "forever war." Trump indicates he will pay closer attention to Iraq, but the question is whether it’s too late.