Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today's WorldView newsletter.

For years, a host of experts and politicians in Washington considered the breakup of Iraq to be virtually inevitable. They viewed its weak central government, its ethnic and sectarian enmities and its intractable insurgencies as symptoms of a failing and ill-conceived state, born out of the ashes of a defeated empire and now doomed to collapse amid the upheavals of a new era.

In 2006, as the United States struggled to deal with the chaos unleashed by its 2003 invasion, future vice president Joe Biden co-wrote a column calling for the division of Iraq along lines akin to Bosnia's ethnic federations. Various Democrats and Republicans favored the long-suppressed aspirations of Iraq's autonomous Kurdish region, which built up a significant lobbying presence in Washington.

In 2014, as the Islamic State captured Mosul, Iraq's most populous northern city, observers considered the country's fractious politics too broken to be repaired. Even now, as Iraqi forces once more patrol Mosul, there are justified fears that Baghdad will never really be able to unite a war-ravaged nation.

But Iraqi Prime Minister Haider al-Abadi has a different view. After championing the reconquest of Mosul, Abadi has over the past month forcefully stared down a Kurdish independence bid and extended the Iraqi government's reach into disputed areas controlled by Kurdish militias since 2014. Abadi, once written off as a weak functionary, now is more popular than ever, The Washington Post reported this week.

“For the United States, Abadi’s surging popularity is probably the silver lining of a crisis that has pitted two of its closest political and military allies — the Iraqi government and the Kurds — against each other,” my colleagues wrote. “Many Iraqi politicians say Abadi has all but assured his reelection next year.”

“Iraq is getting stronger, getting unified,” Abadi told my colleague Tamer El-Ghobashy, who interviewed the Iraqi leader with two other Western journalists late Tuesday in Baghdad. “I think others, or the interference of others in the affairs of Iraq, will become less and less. This is a new-built confidence among Iraqis, the Iraqi national feeling, which our aim is to increase people’s attachment to their own country.”

Even though an overwhelming majority of voters in the Sept. 25 Iraqi Kurdish referendum opted for independence, the nonbinding plebiscite failed to secure greater freedoms for the Kurdish region. Instead, Abadi won the backing of Iraq's neighbors and the United States, who all decried the Kurds' effort and stressed their support for Iraq's territorial unity. Iraqi forces, including Iranian-backed militias, then moved into oil-rich Kirkuk, which had been in Kurdish hands for the past three years and was controversially included in the referendum.

The situation “has left the Iraqi Kurds deeply humiliated, further divided and in their weakest negotiating position since a failed autonomy deal with Baghdad in 1975,” wrote Al-Monitor's Amberin Zaman. Criticism centers on the Kurdish regional president, Masoud Barzani; his opponents insist he engineered the referendum for his own political gain. That effort seems to have backfired, with a rival Kurdish faction helping hand over Kirkuk to Baghdad and internecine squabbles again consuming the Iraqi Kurds. Barzani, notes Zaman, may be compelled to step down in the coming weeks.

“This political elite have squandered the opportunity at a time when we had the international community on our side, when we had an unparalleled economy, unparalleled autonomy,” Barham Salih, a former senior Kurdish official, said to the Financial Times.

“The referendum was based on a fundamental misreading of U.S. policy,” wrote Renad Mansour of Chatham House, a London-based think tank, suggesting that Barzani and his allies mistook the widespread sympathy for the Kurds among American politicians for real support. “For Washington, Iraq represents a rare chance for a success story in the Middle East.”

Abadi is keen to latch on to that success story and steer Iraq out of the shadow of war and ruin. But that doesn't mean he's inclined to do America's bidding. Just this week he rebuffed a request from Secretary of State Rex Tillerson to disband elements of the Popular Mobilization Forces, predominantly Shiite paramilitary forces that were crucial to the war effort against the Islamic State. U.S. officials see some of these units as Iranian proxies.

“Let me be clear,” Sen. John McCain (R-Ariz.) wrote in a New York Times op-ed this week. “If Baghdad cannot guarantee the Kurdish people in Iraq the security, freedom and opportunities they desire, and if the United States is forced to choose between Iranian-backed militias and our long-standing Kurdish partners, I choose the Kurds.”

Abadi, though, declared the units to be “Iraqi institutions” and said they “should be encouraged because they will be the hope of country and the region.” His defiance led the Iranian foreign minister to poke fun at Washington.

But Abadi is no Iranian stooge, either. He has recently courted a range of countries hostile to Tehran — including Saudi Arabia and Egypt — in a bid to win further investment in Iraq. On Wednesday, he was in Ankara, meeting with Turkish President Recep Tayyip Erdogan and discussing the resumption of Kirkuk's oil exports, among other strategic matters.

At the same time, he has stressed his willingness to engage in dialogue with the Kurds and other Iraqi minorities. “The prospect of ethnic and sectarian reconciliation, and of unifying leadership, is emerging as a motif in Iraq’s next general elections, due in April or May 2018,” noted Michael Knights of the Washington Institute for Near East Policy. Abadi is chief among those championing these themes.

And he refuses to accept the idea of his country as a battleground for larger geopolitical games. “We would like to work with you, both of you,” Abadi said of the United States and Iran, in his interview with The Post. “But please don’t bring your trouble inside Iraq. You can sort it anywhere else.”

Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today's WorldView newsletter.