Not much more than a month ago, Iraqi Kurdistan’s leaders seemed sure that their path to independence was all but guaranteed.
The autonomous region controlled swathes of disputed territory once administered by the federal government in Baghdad, including vast oil reserves and energy infrastructure.
Its armed forces, known as Peshmerga, enjoyed a formidable reputation and had cooperated closely with the US and other powerful allies in the fight against Islamic State. The way, they thought, was clear.
But on Monday October 16, Iraqi government forces ousted Peshmerga from the disputed city of Kirkuk along with nearby oil fields that the Kurdistan Regional Government (KRG) had counted on for revenues to sustain an independent state.
The defeat came shockingly fast and prompted a disorderly retreat from other territories that KRG president Masoud Barzani had pledged would never be returned to Baghdad.
It was a rout that blindsided many of Iraq’s Kurds and left their long held dream of secession in tatters. In the regional capital of Erbil, officials, soldiers and civilians alike are still struggling to come to terms with this profound humiliation.
“The Kurdish community never expected such a reaction from the Iraqi government,” said Alan, 26, who asked that he be known only by his first name. “We didn’t expect them to attack us and take Kirkuk by force, it has become like a siege now.”
The crisis was largely impelled by last month’s controversial independence referendum, which faced near-universal opposition.
Neighbouring Turkey and Iran found a rare moment of unity to agree retaliatory counter-measures, while Iraqi Prime Minister Haider al-Abadi threatened military action if the results were not annulled. Even allies — with the exception of Israel — begged the KRG to postpone or cancel the vote, for fear it would destabilise the entire region.
But Mr Barzani pressed on, seemingly confident the results would trigger secession talks in which they would hold a major advantage.
That now appears to have been a miscalculation of epic proportions. Voting went ahead as planned on September 25 and results reflected an overwhelming desire to leave the rest of Iraq.
The backlash was rapid. At first, Baghdad chipped away at existing aspects of autonomy by banning international flights from landing in the region and demanding control of oil exports.
Eventually though, Mr Abadi made good on his threats. Soon after retaking Kirkuk he called for a return to talks. “The illegal referendum is over, its results invalid and belongs in the past,” he said on Twitter. “We call for dialogue based on Iraq’s national constitution.”
A return to the negotiating table now seem to be the only option open to Mr Barzani, though he will be in a far weaker position than before.
Saudi oil minister Khalid al-Falih made a high-profile visit to Iraq on Saturday, as the countries begin strengthening ties in the sector and frosty relations between the countries thaw. On the same day, Mr Abadi left Baghdad for a visit to Saudi Arabia.
Over the weekend, angry protestors in Erbil waved Kurdish flags outside the US embassy and UN consulate, some carrying signs saying, “We need our country”. People outside the Iranian consulate cheered as a man tore down its flag.