The battle for Baghdad may be mostly over; the battle for Kirkuk may be just beginning  and it may put the United States on a collision course not with Saddam Hussein holdouts, but two of its key allies. Iraqi Kurds are cheering the arrival of their guerrilla fighters in Kirkuk Thursday, and the same news has Turkey's leaders confronting their worst nightmare about the war next door. The U.S. had promised Turkey that the Kurdish fighters would be kept out of the northern oil town, and that, indeed, had been Washington's orders to the guerrillas working with U.S. Special Forces to confront Saddam's northern strongholds. But once Saddam's regime began to collapse, the Kurdish fighters took the gap and drove all the way into Kirkuk.

For Iraq's Kurds and Turkey, the northern oil town has always been the key prize in the battle to overthrow Saddam. It was their desire to prevent the Kurds capturing Kirkuk and the other key northern oil town, Mosul, that led Turkey to demand that the U.S. agree to the deployment of tens of thousands of Turkish troops in northern Iraq. Failure to reach such an agreement was a significant factor contributing to Turkey's refusal to grant permission for the U.S. to launch a ground invasion from its territory. But Turkey has since been cooperating with the U.S. war effort, and its foreign minister, Abdullah Gul, said Thursday that he had been promised that the Kurdish fighters would leave the city after U.S. reinforcements arrive, "within hours." Turkey has, meanwhile, sent military observers to the city  a gesture that underscores its statement that it would be "unacceptable" to Ankara if the Kurdish fighters establish a permanent presence in Kirkuk. Ankara has tens of thousands troops poised along the Iraq border, and has warned that it will send them in if the Kurdish fighters are not withdrawn from Kirkuk.

Kirkuk is ground-zero of both Turkish and Kurdish ambitions in northern Iraq. The Turks' primary concern is to counter the ambitions of Iraq's Kurdish nationalists  although the Kurdish parties that have governed the section of northern Iraq liberated from Baghdad in 1991 officially deny they plan to seek an independent state, that goal has long been an organizing principle of local Kurdish politics. And Turkey, fearful that even formalized Kurdish autonomy in Iraq would stoke secessionist passions among its own Kurdish minority, has threatened to send its own troops into the region to keep a lid on Kurdish ambitions during the breaking down of the Saddam order, and to disarm the Kurdish militias.

Kirkuk is claimed by some local Kurdish leaders as the "Kurdish Jerusalem," and viewed as the economic and political hub of any future Kurdish entity or state. More immediately, Kurdish officials have reiterated the intention of tens of thousands of Kurds to return to the city after having been driven out under Saddam's policy of "forced Arabization," a program of ethnic cleansing designed to reinforce Baghdad's own claims on the city. But Turkey views Kirkuk as the rightful property of Iraq's tiny Turkman minority, which has close ties to Ankara and whose historic conflict with the Kurds has at times erupted in bloodshed.

The fate of Kirkuk has loomed large in Turkish negotiations with Washington, and, needless to say, there's not much in the Turkish position for the Kurds to love. Their initial response to the suggestion of even a small Turkish buffer zone 15 miles inside Iraqi Kurdistan was to demand that Turkish troops there be placed under U.S. command  a demand rejected by Turkey, and which the U.S. has reportedly been forced by Ankara's resistance to drop. Kurdish leaders have warned that any Turkish troops in Iraqi Kurdistan would be regarded as invaders. In order to forestall the prospect for a clash between the Kurds and Turkey, the U.S. military may be inclined to seize and occupy the town early in the war. While averting a Kurd-Turk battle for the city, that would nonetheless leave the U.S. forced to adjudicate between the competing claims of two of its allies  a dilemma that may capture in microcosm the larger challenge of managing a post-Saddam Iraq.

The recent Afghanistan campaign offered an unhappy precedent of Washington managing the competing claims of rival allies. Mindful of the concerns of Pakistan, the Bush administration had implored the Northern Alliance (traditionally backed by Pakistan's enemies) to stay out of the Afghan capital, Kabul, after the Taliban fled. But in the heat of battle, there was no way of stopping the key U.S. proxy force from pursuing its own agenda against Washington's wishes, helping set the stage for the current unstable equilibrium in post-Taliban Afghanistan. Now, the Kurdish "peshmerga" appear to have copied the Northern Alliance strategy.

Unlike the 1991 Gulf War whose objective had been to simply restore the Kuwaiti monarchy, an invasion of Iraq to oust Saddam requires that the U.S. actively remakes the Iraqi state. Saddam's regime has brutally suppressed a potentially fearsome array of regional, political and ethnic tensions, many of which can be used to help bring it down. But the nightmare facing any occupying power is how easily it can find itself satisfying no one and making enemies of erstwhile allies. The evolving situation in northern Iraq right now is a reminder that winning the peace in Iraq will almost inevitably be harder than winning the war.