There are no winners among Iraq's Kurds, just weeks after Kurdish president Masoud Barzani gambled away his people's autonomy in a defiant independence referendum.
The losing bet has come at a steep price for everyone involved.
Barzani has had to give up the presidency, his Kurdish political foes have angered their popular base, and the Kurdish people, who overwhelmingly voted to break away from Iraq, feel further than ever from their lifelong dream of independence.
The ultimate winner, analysts say, is Iran, widely believed to have backed and orchestrated Iraqi Prime Minister Haider al-Abadi in his Oct. 16 offensive to recapture Kurdish held-areas, including the oil-rich city of Kirkuk.
"The Iranians outwitted the Americans; they were the driving force behind the deal to hand over Kirkuk," said Hassan Shaaban, a political commentator and rights activist in Baghdad.
The balance of power has been transformed in the north of Iraq, exposing the limited hand the Kurds have to play in future negotiations. It has also exposed the dominant role Iran played in transforming the fate of the Kurdish region.
Iran is poised to exploit the political aftermath, pushing to move the centre of power from the regional capital Erbil, where the Barzanis and the Kurdistan Democratic Party (KDP) have dominated, to its Kurdish allies in the city of Sulaimaniya.
"Iran was always one step ahead on the referendum," said Renad Mansour, an Iraq expert at the Chatham House think-tank.
They knew Barzani was never going to postpone the vote, he said, adding: "The U.S. was left scrambling while the Iranians were plotting."
A senior Iranian official said Tehran had advised Barzani against the referendum but he would not listen.
"We tried to stop this referendum because it was not in their interest. But unfortunately Mr Barzani miscalculated his social base among Kurds and went ahead with the vote," Ali Shamkhani, secretary of Iran's National Security Council, was quoted as saying by Mehr news agency on Tuesday.
Iranian Major-General Qassem Soleimani has for years been allied to the Patriotic Union of Kurdistan (PUK), the main rival of Barzani's KDP.
But the referendum has drawn the powerful Iranian commander even closer to Kurdish politics, and shown how far Iran's reach has extended beyond the central government in Baghdad.
Ahead of the vote, Soleimani warned Kurdish leaders in northern Iraq to withdraw their forces from Kirkuk or face a "fiery" onslaught by Iraqi forces and Iranian-backed fighters, according to Kurdish and Iraqi officials.
The warning prompted Kurdish Peshmerga fighters to withdraw from most areas, and deepened the split between Barzani's power base in Erbil, and the rival Talabani clan in Sulaimaniya, long allied with Iran.
Iraqi politicians have voiced concern about the growing influence of Iran, despite praising Abadi for reining in Kurdish ambitions.
"We feel worried seeing the octopus arms stretching deeper in the north," said Ahmed Asi al-Obeidi, a Sunni tribal sheikh and a member of Kirkuk's tribal council.
"We all have seen the problems Iranian meddling has caused in other parts of Iraq, including mainly Sunni areas, and if the same amount of interference is repeated in Kurdish areas, then the worst is coming and instability will prevail."
Addressing his people, demoralized by humiliating territorial defeats, Barzani said on Sunday that he would step down, just one month after the vote he championed in the face of regional and international opposition.
He accused his enemies of committing "high treason" in surrendering Kirkuk to Iraqi forces without a fight, while his rivals have directed the same accusation against him for holding the referendum in the first place.
The vote and its ensuing political and military retribution from Baghdad - backed by Iran and Turkey - demolished the position of relative strength the Kurds had enjoyed for years.
The blame has been placed on Barzani's shoulders, both by his political opponents, notably the rival Talabani clan allied to Iran, and his Western allies, who were angered by his insistence on holding the vote against their advice.
On Sunday, Kurdish lawmakers agreed to divide Barzani's presidential powers between parliament, the judiciary and the government, in the absence of imminent presidential elections and a named successor.
Barzani remains head of the KDP, which dominates parliament and government, and will still sit on the High Political Council, an opaque non-governmental body which emerged after the referendum. He will thus retain his ability to influence policy.
Barzani could therefore mitigate the mounting political chaos. But his position instead highlights the lack of clarity over who is in charge as crucial negotiations with Baghdad get underway over the region's future.
Dominant since he became president in 2005, Barzani has consolidated the power of his office, and boosted his family members' political profiles.
Before the referendum, Barzani's son Masrour was his likely successor, but he has been damaged by his backing for the vote.
Instead, Nechirvan Barzani, Masoud's nephew and the regional prime minister, has moved to the fore. He has gained some of Barzani's newly devolved presidential powers, and maintained ties with the Kurdish opposition, making him a more palatable candidate to mend regional fences. He also enjoys a close relationship with Turkish president Tayyip Erdogan.
On Monday, the United States commended Barzani for stepping down and said it would "actively" engage with Nechirvan, and his deputy, Qubad Talabani, a member of the rival political faction with whom he maintains a good relationship.
Who emerges as the next leader of the Kurdistan Regional Government is anything but straightforward. In addition to an intra-Kurdish compromise, the influence of Baghdad and Iran will have to be considered.
Senior Kurdish officials from both the KDP and PUK say their best bet is to present a united front in negotiations with Baghdad. But that now seems all but impossible.
Iraqi forces, including the Iran-backed Shi'ite militias, now control border crossings in the north, vital trade routes for the Kurds. The military capitulation in Kirkuk was a crushing blow to the Kurds, both morally and financially, halving the region's oil export revenue overnight.
Now the Talabanis are facing their own succession crisis, following the death of former president Jalal Talabani.
"Iran saw the disintegration of their Kurdish ally in Talabani," said Mansour, who added Iran needed a clear successor to ensure its continued influence.
Another set of sons and nephews are vying for leadership in the aftermath of the referendum. But the PUK base has expressed more widespread disappointment with how their leadership handled the Kirkuk crisis.
"We were betrayed by our leaders in Kirkuk, who stopped us from fighting the (Iraqi Shi'ite) militias," said a PUK-allied Peshmerga commander who asked not to be identified for fear of retribution. "They sold us to Iran for their own benefit."