So the Iraq war ends. What began as a mad dash to Baghdad without much worry about what came next, complete with an infamous May 1, 2003, "Mission Accomplished" moment ("In the battle of Iraq, the US and our allies have prevailed" President Bush said from the deck of the USS Abraham Lincoln then) quickly cratered into an insurgency and civil war that claimed at least 100,000 Iraqi lives and 4,500 American ones.

Now it's over, and it's time for a thousand retrospectives to bloom. US politicians and the pundits that serve them have been trying to frame the Iraq war in terms of whether Bush won Iraq, or Obama lost it, or vice versa. They're almost all of them wrong. The claim that President Obama met a campaign promise today is technically true – but only because Iraqi Prime Minister Nouri al-Maliki forced him to. Obama was seeking to keep troops in Iraq, perhaps as many as 15,000 of them, beyond the Dec. 31 withdrawal date.

But the Iraqi government, led by Shiite Islamists with ties to Iran and well aware that an extension of the US occupation would be political poison for them (already dealing with public anger at rampant corruption and poor service delivery), had none of it. Mr. Maliki told Obama he could have his troops in the country if they were subject to Iraqi law, something he and everyone else knew was a deal-breaker.

The claims from the right that Obama has "abandoned" Iraq are equally absurd, for the reasons just explained. Max Boot, a hawkish pundit and one of the most ardent boosters of the Iraq war at the time of the US invasion, writes this week that Obama is "attempting to put his abandonment of Iraq in the best possible light" and that he's "taking an enormous gamble, not only with the security of Iraq, the United States, and the entire Middle East but also with his own historical reputation."

Obama had absolutely no say in the decision to leave Iraq. Beyond a decision to reoccupy the country – strip Maliki's duly-elected government of sovereignty and send in the Coalition Provisional Authority 2.0 (former CPA chief Paul Bremer might even be available for the mission again) – we had to go. It's also true that the US public had tired of the war ($800 billion and change) and the US departure now is popular. But the US has been more or less locked into this outcome since 2008, when President Bush signed a Status of Forces Agreement (SOFA) with the Iraqis that expires Jan. 1, 2012.

The SOFA was represented as an achievement in its own right, which it was, since it marked the transition from a time when the US military in Iraq acted by fiat to one in which it was present with the permission of a sovereign government. While it was hoped that in the intervening years the US relationship with Iraq's senior officials would strengthen, and perhaps we'd be invited to stay around a while longer, that was almost always going to be disappointed.

The simple fact of the matter is that one of the few things that Iraq's majority Shiite Arabs and minority Sunni Arabs agree on is that the US military presence, universally deemed an occupation, was a national humiliation. Were Maliki to have granted the US an extended stay, allies from his coalition government would have abandoned him in droves.

That's actually one of the pieces of good news in Iraq – the public will, and politics, now affect what happens.

Unlike Saddam's era, no one is ruling by fiat. That isn't to say the country is a flourishing democracy – far from it. The country still has high levels of sectarian violence (though much lower than the height of the 2006-07 civil war), security forces that routinely torture detainees, and an emerging authoritarian political culture that are all causes for concern. From an American perspective, the Maliki government's warm relations with Tehran (and to a lesser extent, Damascus) are a disappointment, but hardly surprising.

Many of the Shiite politicians the US helped bring to power were Iranian clients in exile during Hussein's reign, have social and religious ties to Iran, and recognize that Iran is a permanent neighbor, the US a more fleeting presence.

Yes, the Iraq war is over and Iraq is acting like an independent nation. The US will have to get used to it.

Follow Dan Murphy on Twitter.