The jihadist blitz through northwestern Iraq has ended the fragile peace that was established after the 2007-2008 US surge. It has cast grave doubt on the basic capacity of the Iraqi army—reconstituted, trained and equipped at great expense by Washington—to control the country, and it could bring down the government of Prime Minister Nouri al-Maliki, whose eight-year reign has been marred by mismanagement and sectarian polarization. But for Iraqi Kurds, the offensive by the Islamic State of Iraq and Greater Syria (ISIS) and other groups has offered a dramatic opportunity: a chance to expand their own influence beyond Iraqi Kurdistan and take possession of other parts of northern Iraq they’ve long claimed as theirs.

At the heart of these “disputed areas” is the strategic city of Kirkuk, which the disciplined and highly motivated Kurdish Peshmerga took over in mid-June, after Iraqi soldiers stationed there fled in fear of advancing jihadists. A charmless city of slightly less than one million people, Kirkuk betrays little of its past as an important Ottoman garrison town. The desolate ruin of an ancient citadel, sitting on a mound overlooking the dried-out Khasa River, is one of the few hints of the city’s earlier glory. Yet Kirkuk lies on top of one of Iraq’s largest oil fields, and with its crucial location directly adjacent to the Kurdish region, the city is the prize in the Kurds’ long journey to independence, a town they call their Jerusalem. When their Peshmerga fighters easily took over a few weeks ago, there was loud rejoicing throughout the Kurdish land.

But while the Kurds believe Kirkuk’s riches give them crucial economic foundations for a sustainable independent state, the city’s ethnic heterogeneity raises serious questions about their claims to it. Not only is Kirkuk’s population—as with that of many other Iraqi cities, including Baghdad itself—deeply intermixed. The disputed status of its vast oil field also stands as a major obstacle to any attempt to divide the country’s oil revenues equitably. To anyone who advocates dividing Iraq into neat ethnic and sectarian groups, Kirkuk shows just how challenging that would be in practice.

The definitive loss of Kirkuk and the giant oil field surrounding it could precipitate the breakup of Iraq, and while the present government in Baghdad is in no position to resist Kurdish control, a restrengthened leadership might, in the future, seek to retake the city by force. For the Kurds, the sudden territorial gains may also not be the panacea they seem to think they are. The Kurdish oil industry is still much in development, and if the Kurdish region loses access to Baghdad’s annual budget allocations without a ready alternative, it is likely to face a severe economic crisis. Moreover, the same jihadist insurgency that has enabled Kurdish advances in the disputed territories is also a potent new threat to the Kurds themselves. So the taking of Kirkuk poses an urgent question: how important is Iraq’s stability to the Kurds’ own security and long-term aims?

I first visited Kirkuk some twenty-three years ago, driving from Baghdad and entering from the west. Coming up from the capital in those days one had little doubt that one was in Arab areas all the way to the outskirts of Kirkuk, while the city itself, like many urban conglomerations in the wider region, was home to many different ethnic and religious groups, none of them dominant. There were Shia mixed in with Sunnis, and along with three major ethnicities—Arab, Kurdish, and Turkic—the city contained a smaller population of Chaldo-Assyrian Christians, who claimed to be original inhabitants of what was known in ancient times as Arrapha. In fact, despite the Kurds’ strong presence in Kirkuk today, many of them were relatively late arrivals, having settled mostly in the years since the oil industry first took hold in the 1930s.

Kurdish nationalists had long made it a quest to incorporate Kirkuk into the Kurdish region. But in 1991, with Saddam Hussein still in power after the Gulf War ended, Iraqi forces reasserted control over the north, brutally crushing the Kurdish uprising. I was one of the first Western visitors to the town after these tragic events, traveling for Physicians for Human Rights. The detritus of recent conflict was everywhere: earthmovers systematically flattening a Kurdish neighborhood; dead bodies and overturned tractor carts strewn along the road to Erbil; maimed victims of landmines in a Suleimaniya hospital; a grimacing Kurdish fighter bound to something that looked like a telephone pole being carried, face down, into a Chamchamal police station.

To behold such agony, one could only feel sympathy for the Kurds. In seven decades of being Iraqis, they had never had control of their own destiny. Instead, their villages had been destroyed and their population subjected to gas attacks and mass killings amounting to genocide. In Kirkuk, successive Iraqi regimes had uprooted many Kurds and resettled Arabs from the south to supplement indigenous tribes.

Following the Gulf War, when the US enforced a no-fly zone and Baghdad withdrew its troops, the Kurdish autonomous region to the north of Kirkuk gained de facto independence (while being economically suffocated by its neighbors); after the 2003 US invasion it became a region in a federal Iraq. But Kirkuk was not part of this region, its status being left to a referendum to be carried out before the end of 2007; the inability of the federal government in Baghdad and the Kurdish regional government in Erbil to resolve their differences ensured that such a referendum never took place.

The Kurds have tried to play down the importance of Kirkuk’s oil revenues, but the city’s overriding economic value is clear. Until recently, revenue from the Kirkuk oil field (which in 2013 came to about $6 billion from the export of 180,000 barrels per day, far below the field’s potential) was the only wealth to be derived in Iraq’s north, and it landed in Baghdad’s coffers. Since 2003, foreign companies have also been busy prospecting for oil in the Kurdish region, registering major finds and thereby in theory diminishing the singular value of Kirkuk to the Kurdish government. This year, the completion of a new pipeline from Iraqi Kurdistan to Turkey has allowed the Kurds to begin shipping Kurdish oil from its own fields directly to Turkey without seeking Baghdad’s approval.

Yet it remains unclear how readily this Kurdish oil can be sold in the international market, as buyers fear litigation by the national government in Baghdad. The stranded oil tanker carrying the first shipment of Kurdish crude—it has been stuck off the coast of Morocco, prevented from discharging its load—is emblematic of the difficulty a non-state entity faces in finding buyers in defiance of a sovereign state’s export policy. In the meantime, the Kurdish region’s economic boom has been financed far less by its own oil revenue than by its share in Iraq’s national budget, which derives instead from the sale of oil from the country’s vast oil fields in the south. As part of an ongoing political dispute between the central government and the Kurds, Baghdad has withheld Erbil’s budget since the beginning of this year, a situation that, if it continues, could make Kurdish authorities all the more desperate to establish their own independent revenue stream.

Until recently, the Baghdad-controlled North Oil Company piped Kirkuk’s oil westward to Baiji, then northward to the Turkish border and on to the Mediterranean. Now, with the Kirkuk oil field in the hands of Kurdish Peshmerga, the Kurds have a historic opportunity to send the city’s oil through the new pipeline to Turkey instead, thus bypassing Arab territory and therefore any sort of Arab control, whether from Baghdad or jihadist insurgents. Moreover, having seized the city, they will try to accelerate its accession to the Kurdish region by council vote and local referendum. As Falah Mustafa Bakir, the Kurds’ de facto foreign minister, declared in an interview, “the border has changed. The political reality has changed. The power balance has changed. And…Baghdad is far away.”

If the Kurds manage to find buyers for their oil and the Iraqi government remains paralyzed by sectarian war, the Kurds will be taking one giant step toward independence, with Kirkuk included in their new state. Abandoning all his customary reluctance to be called out on the statehood question, the regional president, Masoud Barzani, has now said he would like to see a referendum on Kurdish independence within months. But there are many obstacles to such a plan.

The first is the Obama administration, which does not want to see Iraq break up and could try to block further sales of Kurdish oil. The US is seeking to contain the conflict between the country’s competing ethnic and religious groups within the national borders established almost a hundred years ago. Thus Washington is now pushing for a truly inclusive power-sharing government in Baghdad that could be supported by Iran. (For this, the next prime minister would have to be a Shia Islamist, like Maliki.) If such a national compact can be reached and upheld—that holy grail of the post-2003 US enterprise in Iraq—the Kurds will have to play an essential part in it.

It is therefore more likely that, rather than making a beeline for an independence that neither the US nor Turkey seems to support, the Kurds will find themselves negotiating again in Baghdad, but this time with a significantly stronger card in their hands: their control of Kirkuk oil. As long as they are hitched to Iraq, the Kurds will demand guarantees for the timely and full delivery of the region’s annual budget allocation, the right to export and sell Kurdish oil, and Baghdad’s acquiescence to their permanent stewardship of Kirkuk and its resources. Of course, these are conditions that in and of themselves would advance their march toward independence, with their own oil-produced income gradually replacing the budget allocations derived from southern oil, and any would-be Iraqi leader who agrees to them could be committing political suicide. Negotiations toward a new government will therefore be hard and difficult.

Another obstacle to the Kurds’ quest for Kirkuk is the unresolved matter of the location of the future independent entity’s boundary. This is where oil deposits become pivotal, especially in an economy where a single commodity accounts for over 90 percent of national income (in both Iraq and the Kurdish region).

Finally, having taken over Mosul and other cities in northern Iraq, Islamist militants are facing off with the Kurds along a line the length of the Kurdish region. In Kirkuk, the jihadists are virtually at the city gates. For now, their attention is trained on the Shias in Baghdad, but this could change. Already, there have been deadly clashes near Khanaqin, in the far eastern sector of the disputed territories on the Iranian border. Other areas with a mix of population groups, such as Tuz Khurmatu, will be equally susceptible to lethal confrontations. The threat posed by these groups suggests that, for the moment, Baghdad and the Kurds need each other.

What is required—now more than ever—is an inclusive national pact, hammered out by all major Iraqi parties, including the Kurds, that would bring Sunnis back into the government, allow for Kirkuk to be shared and to retain its multicultural character, and to settle the paramount question how Iraqi hydrocarbons are to be managed and revenues distributed. The alternative could be unending conflict, however strong the Kurds may seem today.