PESHMERGA militiamen pile armchairs and sofas high on a removal van as they decamp from the dam above Mosul to the plain below. Mosul, Iraq’s second city and the nerve centre of Islamic State (IS), lies in their sights. Thanks to coalition arms, training and air power, the peshmerga, Iraqi Kurdish troops whose name means “one who confronts death”, now surround it on three sides. Together with Baghdad’s army, they are also closing in from the fourth side, the south. “Whatever we take, we hold,” says a peshmerga intelligence officer, surveying IS dugouts from a trench on the front line.

For 28,000 square kilometres (11,000 square miles) behind him, Kurdish flags now fly over the remains of deserted and destroyed Sunni Arab villages and towns. Time and again, the peshmerga have chased the jihadists out. In Syria, too, Kurdish forces boast similar gains. Thanks to the war on IS, they control some 600km of Syria’s 800km northern border with Turkey. In March they declared their own autonomous region there, Rojava. In Turkey and even in Iran, Kurdish armed groups have ended years of ceasefire and taken up arms. Rarely in their century-old bid for statehood has the dream of carving a Kurdistan from the rumps of four states appeared so nearly within reach.

Mayhem in all four has helped their cause. In Iraq the area ruled by the Kurdistan Regional Government (KRG) has been beyond the effective control of Baghdad since 1991; only Kurds over 40 now speak Arabic there. Having struck oil, the KRG’s leaders sell it independently of Baghdad, exporting it through their own pipeline to Turkey. “Iraq is over,” says Heman Hawrami, a confidant of the KRG’s president, Masoud Barzani. “Statehood is the only practical solution.”

Yet if so, why do they delay declaring it? In a referendum in 2005, 99% of KRG voters chose Kexit. A decade on, Kurdish officials say they need a second vote, but will not name a date.

Infighting is the main reason for delay. Having taken back control of their territory in Iraq and Syria, the Kurds have proved incapable of sharing it. The alphabet barely has enough letters to cover the acronyms of all their quarrelsome factions. A Syrian analyst counts 45 in Rojava alone. In Iraq there are almost as many.

An opportunity squandered

Had they matched IS’s unity and determination, the Kurds could have erased the lines the Western powers drew on the map after dissolving the Ottoman empire, and declared a unified Kurdistan. Instead, on either side of Iraq’s northern border with Syria, Kurdish militias now train their guns on each other, hungry for control of the territories and oilfields they have captured from IS or the Assad regime. The People’s Protection Units (YPG) hold Rojava as well as bases in Mount Sinjar, west of Mosul, on Iraq’s side of the border. Opposing their advance, Mr Barzani has cobbled Syrian Kurdish exiles into his own “Rojava Force”. “We’re upholding Sykes-Picot borders,” says one of its commanders wryly, using the shorthand for the partition of the region into various Arab states but not a Kurdish one.

Barzani the autocrat In Iraqi Kurdistan, the core of their putative state-in-waiting, the two dynasties that fought a nasty civil war back in the 1990s are also at loggerheads again. At a highland checkpoint on their old demarcation line, the smiling portraits of the two old clan leaders, Mr Barzani and Jalal Talabani, face each other some 300 metres apart. But their men now appear to be hell-bent on reviving hostilities. From Erbil, their capital, Mr Barzani’s forces expel dissenters eastward. The banished include the Speaker of the KRG’s parliament, who dismisses Erbil as “occupied” and wants parliament moved to “liberated” Sulaymaniyah, Mr Talabani’s base in the east. Partisan satellite channels fan the flames. In June the offices of Rudaw, a pro-Barzani news agency, was firebombed. Barham Salih, a former KRG prime minister, warns that “Kurdistan is degenerating into warlordism and corrupt fiefdoms.” Such rivalries make it all the easier for regional powers to turn the Kurds into their pawns. In 1996 Mr Barzani’s men rode the tanks of their former murderer, Saddam Hussein, into Sulaymaniyah. Mr Talabani needed Iran’s forces to win it back. Today Iraq is preoccupied with its own fighting, and the chief puppeteers are again Turkey and Iran. Trade follows geopolitics: Erbil’s huge malls offer Turkish brands, whereas shelves in Sulaymaniyah are stacked with Iranian goods. Turkey’s pipeline through Erbil gives Mr Barzani control of KRG oil revenues, but also makes him dependent on the Turks. Loth to lose influence, Iran is helping Mr Talabani’s men finance a second pipeline from its refineries in Kermanshah to the oilfields of Kirkuk, which Mr Talabani’s forces control. Harder power is at play too. Iran and Turkey are training, arming and directing rival Kurdish militias, say Kurdish intelligence chiefs from both sides. Mr Barzani echoes Turkey in describing the YPG as the Syrian arm of the PKK, the Kurdish armed group waging a bombing campaign against the Turkish state. For three months earlier this year, Mr Barzani joined Turkey in closing the border. He imposed a siege on the YPG at the height of its war with IS. “Our wounded came to the borders and were forced to go back,” protests the YPG’s political representative in Sulaymaniyah. While Mr Barzani works with Turkey to thwart the PKK and its ally the YPG, Mr Talabani (with a nod from Iran) helps build them up. Both armed groups operate from his territory, and the PKK is said to have helped him bolster his hold on Kirkuk. Some say their mission to join up the disparate Kurdish dots fits in with Iran’s hopes of pushing west to the Mediterranean like Darius I, an ancient Persian king.

In the meantime, the rivalry between Turkey and Iran is prising Kurdistan apart. Neither country wants to allow the birth of a Kurdish state that could inspire and lend material assistance to their own Kurdish separatists. Western support for the Kurds, too, has its limits. Since 1991, when the UN set up a modest Kurdish haven in Iraq’s snow-capped mountains, Western powers have been the Kurds’ guarantors.

Trouble within

But in their single-minded focus on IS, they have turned a blind eye to Kurdish infighting, sent copious arms and provided the air cover to expand Kurdish control in Syria and Iraq. A slew of Arabic towns have acquired Kurdish names. (Kobani, the Kurdish name for Ain al-Arab, is said to derive from the mispronunciation of Company, after the railway contractors who worked there.) “The US is subsidising Kurdish bad practices,” says Bilal Wahab, a Kurdish academic in Sulaymaniyah.

Kurdish nervousness is entirely understandable. Twice over the past century, in 1922 and 1946, Kurds have declared their own state only to see stronger powers crush it within months. Even so, they might have done more to prepare their institutions for government. Too often, the leaders of the KRG have replicated the bad practices of their neighbours. Having taken control of the production and sale of oil, the Barzanis seem bent on concentrating power in their own hands. “La Familia” is the nickname Kurds have given to the president, his son and intelligence chief, Masrour, and his nephew and prime minister, Nechirvan. Journalists and judges, who might have been able to hold them to account, collect salaries to do their bidding. And since Mr Barzani began selling his own oil he has dispensed with the need for a budget. Parliamentary requests to scrutinise the accounts are ignored. “I’m not allowed to ask,” says Taha Zangana, the deputy oil minister.

As long the revenues kept rolling in, no one quibbled much. The KRG posted solid growth for years. Its rulers built luxury hotels and apartments, fancying they were creating a second Dubai. In 2013 Mr Barzani won cross-party support for a two-year extension of his second presidential term, before succumbing to hubris. No sooner did he begin exporting oil than Baghdad cut off the money it used to transfer to help fund the KRG, some $10 billion annually.

Oil prices have also plummeted. As the coffers emptied, the critics brayed. Since parliamentarians gathered to debate the future of the presidency last year, Mr Barzani’s party has boycotted parliament, denying it a quorum; he has also barred its Speaker from Erbil. On the streets, the security forces silenced protests by opening fire. In effect, Mr Barzani now rules a one-party state under the faction he has led for 37 years. His rule has been without a mandate for the past year.

His finances are a shambles, too. The tiny KRG (population around 5m) has an astonishing $20 billion of debt, and its banks have exhausted their liquidity, says Qubad Talabani, the deputy prime minister and son of Jalal, appointed to devise a reform programme. In a bid to survive, he says he has halted 4,000 projects worth $5 billion, built up arrears with contractors and 1.4m government employees and beneficiaries, and cut salaries by up to 75%. The region has plunged into recession. The oil companies have downsized sharply; Total, a French firm, has walked out. Returning exiles educated in the West are leaving again, along with a larger illegal flow. In lieu of salaries, some peshmerga are said to have sold their American weapons to IS.

Yet the KRG is worth saving. It retains a surprisingly tolerant multi-faith air, where ministers sip vodka and orange on a Ramadan afternoon in restaurants playing Lebanese love songs. It has generously opened its gates to 1.8m refugees and displaced people who thronged to the KRG from more miserable parts of the Middle East.

Ironically, Baghdad may yet provide a breathing-space. When Mr Barzani went it alone with his oil exports, some Baghdad officials said good riddance, counting up the savings from cutting the KRG’s subsidies. As their economic crisis intensifies, though, Kurdish officials are heading back to Baghdad to seek a share of its IMF loan and continued payments for the displaced. They stand a good chance of getting them. The Talabanis, who have long adopted a more pragmatic approach to Baghdad than the Barzanis, advocate a final attempt to make Iraq work. After all, says the redundant Speaker of the Kurdish parliament, “we don’t need another failed state.”