Days after the Kurdish Region of Iraq held a controversial independence referendum, Baghdad sent army and militia units to attack Kurdish positions in and around Kirkuk in the disputed territories. Such swift, aggressive action demonstrated Prime Minister Haider al-Abadi’s insistence that Iraqi Kurds will remain a part of his country, by whatever means necessary. Now, we are seeing the first repercussions: Long-time Kurdish Region President Masoud Barzani, who pushed for the referendum, resigned on October 29, sparking riots in the Kurdish capital of Erbil and other Kurdish cities, and launching new recriminations among Kurds and between Arabs and Kurds.

For America, the short, sharp fighting in northern Iraq has revealed a brutal truth: Its dream of a democratic and federal, united Iraq is over. Ironically, that dream dies just as the Americans and their allies are winning major battlefield victories against the Islamic State in Syria and Iraq. Raqqa, the capital of ISIS, fell to a U.S.-sponsored battlefield coalition of Syrian Arabs and Kurds. U.S.-backed Iraqi forces, meanwhile, captured Hawija, one of the last ISIS strongholds in the country. But as the fighting shows in Iraq and foreshadows in Syria, Washington never had a political plan to deal with the underlying ethnic and sectarian contests for power that originally gave birth to ISIS.

As the senior political officer of the U.S. embassy in Baghdad from 2004 to 2006, I witnessed the contentious beginnings of the recently reborn Iraqi state. It was a difficult time: Insurgents across western, central, and southern Iraq were attacking American and allied military units attempting to preserve a small measure of stability. In the spring of 2005, elected Iraqi parliamentarians began drafting a new constitution—an effort in which we played the midwife. We wanted a new, permanent government, capable of taking over security rapidly so we could withdraw U.S. forces.

From the beginning, the Kurdish negotiators in the constitution talks were nervous. Since the imposition of a no-fly zone in 1992 during the reign of Saddam Hussein, the Kurdish Region has had its own government, defended on the ground by its peshmerga fighters. In 2005, Barzani emphasized to us that the Kurdish Region ought to be able to choose independence, but would join the new Iraqi republic nonetheless. Largely at the Kurds’ insistence, the preamble to the Iraqi constitution states that the Iraqi people could “decide freely and by choice to unite our future.” In the negotiations, the Kurds stressed the inclusion of the word “freely.” They appreciated its implicit meaning: they chose freely to join Iraq, and they could choose freely to leave.

Both in 2005 and in subsequent years, Barzani emphasized that only if Baghdad scrupulously respected the obligations of the constitution would Iraqi Kurdistan remain in the Iraqi Republic. This included implementation of Article 140 of the constitution, which called for the resolution of the future of the contested city of Kirkuk and other territories straddling the border separating the Kurdish Region from the rest of Iraq. The Kurds claimed these territories had been Kurdish until Saddam expelled large numbers of Kurds and replaced them with Arab farmers from southern Iraq. Eager to get on with new Iraqi elections and facilitate a permanent government, we readily promised to ensure that scrupulous respect of the constitution.

Of course, we didn’t deliver; we probably never could have. During my four and a half years at the embassy, we protected the election process by building consensus among squabbling politicians, calmed confrontations between Barzani’s peshmerga and the Iraqi army, and ensured the inclusion of Sunni Arabs in the national government. On top of this, we also had a major insurgency and terror campaign on our hands.

We knew that our failure to address the disputed territories and conflicting Kurdish-Arab claims to places like Kirkuk was dangerous. When I was back working in Iraq again from 2008 to 2010, Ambassador Ryan Crocker predicted in a senior staff meeting that our leaving the Kirkuk issue unresolved “would destroy Iraq.” Distracted by each new crisis du jour, we never mounted a sustained, determined effort to bring Erbil and Baghdad together to resolve the smoldering problem of the disputed territories.

Events in the disputed territories now serve as a painful microcosm of how Iraqis handle major political disputes. In 2014, the Kurdish Region took advantage of Baghdad’s military weakness in the face of ISIS’s blistering advance to send peshmerga to seize Kirkuk and its adjacent oilfields. There was no political discussion or dialogue between the Kurds and the weak government in Baghdad; the Kurds just used force of arms. To be fair, had the Kurds not done this, ISIS would surely have seized the territory and its oil. It was a serious overreach for the Kurds, however: Taking the oilfields and ruling the ethnically mixed city of Kirkuk further poisoned Kurdish relations with many in Baghdad. The Americans said nothing, instead insisting that the Iraqis set aside their old grievances for the sake of the struggle against ISIS.

But the Baghdad government didn’t forget what the Kurds had taken. In December 2016, one prominent pro-Iranian militia, also fighting against ISIS, vowed to reverse the Kurdish seizures, declaring that after ISIS the Kurds were Iraq’s biggest problem. Then, after the Kurdish Region’s September 25 independence referendum, the furious Iraqi parliament demanded the prime minister send troops to recapture Kirkuk. Still, the senior-most Sunni Arab in government, Parliament Speaker Salim al-Jabouri, backed Kurdish requests to set arms aside and pursue dialogue.

But Abadi and the Baghdad government—far stronger and with Iranian and American backing—would have none of it, rejecting appeals for dialogue and threatening force. On October 19, the outnumbered Kurds unhappily relinquished Kirkuk and the oilfields without a fight. Again rejecting renewed Kurdish appeals for dialogue, Abadi demanded that Erbil cancel the referendum and turn over its airports and control of its border points. Iraqi forces and the Iran-backed Shia Islamist Popular Mobilization brigades marched into other areas in the disputed territories and the point where Turkey, Syria, and Iraq meet. The Iraqi forces and the peshmerga eventually agreed to a temporary ceasefire on October 28, but there is no resolution in sight for the disputed territories and the future of Iraq’s Kurds.

While Abadi and others in Baghdad condemned the Kurdish vote as illegitimate, there is nothing in the Iraqi constitution that expressly forbade such a non-binding referendum. Moreover, its result merely confirmed what everyone in Iraq already knew: Iraq’s Kurds don’t want to be in Iraq. At least not for much longer.

This poses the question of how democratic Iraq could ever be when such a large segment of its population wants out. Oil revenues can help bind Iraq’s Arab and Kurdish communities. The communities are, however, very far apart politically and socially. If Iraq is to find stability, reaching a political solution to integrate Iraqi Kurdistan into broader Iraq seems unavoidable.

The United States always hoped Arabs and Kurds could share power in the central government. It hasn’t worked out that way. While the ceremonial president of Iraq is a Kurd, real power lies with the Shia Islamists led by the prime minister. More importantly, in a polity as fragile as Iraq’s, control over the security forces (not just the odd cabinet post like the Kurdish-held culture minister slot) is vital. While Iraq’s constitution mandated power-sharing there, too, its Shia hold the senior command posts. A former peshmerga general had held the post of chief of staff of the armed forces, but he quit in 2015, saying that Kurds made up only 1 percent of the Iraqi army. He also complained that Baghdad’s interference prevented him from exercising his command responsibilities.

Hopes for a sharing of real power dimmed considerably in September 2016, when Iraq’s Shia-Islamist-dominated parliament booted out the finance minister, the top Iraqi Kurd in the cabinet. Now, a year later, it is impossible to imagine that power sharing in united Iraq could enable Sunni Arabs or Kurds to control any key levers of the state. The Popular Mobilization militias so strong in Baghdad, for example, would never take orders from them.

It’s no surprise, therefore, that young Kurds don’t look much to Baghdad as a beacon for their loyalty. Many young Kurds don’t even study Arabic, focusing instead on Kurdish and English. The referendum, approved by about 93 percent of voters, demonstrated that Iraqi Kurds don’t want to remain a part of Iraq forever.

Meanwhile, America has been loath to throw out its script about a democratic, united Iraq whose people come together against a weakened ISIS, despite the fact that Baghdad and Erbil have long been looking ahead to a post-ISIS future. Washington’s plan, it seems, is to swap in a new antagonist.

During a visit to Iraq on October 24, Secretary of State Rex Tillerson asserted that Iran-backed militias should go home; his statement, a hamfisted appeal to Iraqi nationalism, drew the ire of Abadi, who countered that the militia fighters were Iraqi patriots, and that America should not interfere. Two days later, Tillerson again urged Iraqis to resist Iranian pressure because “Iraqis are Arabs”— a remark that surely annoyed Iraq’s Kurds and other ethnic minorities. In the tortuous constitutional negotiations of 2005, the Kurds had refused to sign a text that called Iraq an Arab state. The Iraqi constitution includes no such declaration.

After all this time, Washington doesn’t seem to get it. Iraqis are preoccupied with their domestic struggles, not with interference from Iran or other foreign states—some Iraqis welcome outside help against domestic competitors. Some in the U.S. foreign policy establishment are urging the United States to mediate the dispute between Baghdad and Erbil. To pull that off, however, it would need to avoid distraction, and act with more than a little sensitivity and an awareness of Iraq’s evolution.