After the American presence was terminated, badly and irresponsibly, there were grave consequences for Iraq and the wider region.
Iraqi democracy was not so bad - until US pulled out
At the 10th anniversary of the start of the Iraq war, Iraqi politicians are busy preparing for local elections, and parliament has just passed the annual budget.
Can we take these apparent workings of a normal democracy as indications that the war was a great success?
To evaluate the democratic quality of Iraq's local elections, it is instructive to see how the biggest political parties interact with the electorate.
After periods of civil-war-like conditions in the past decade, a key indicator can be found in the electoral fortunes of those political parties that have a national orientation; those capable of appealing to voters of whatever ethnic or sectarian background.
By that measure, today's Iraqi political landscape is not encouraging. Only one coalition, the secular Iraqiyya, is making a wholehearted effort to win votes in both Sunni and Shiite areas. The remaining parties, Kurds and Shiite Islamists, are competing mainly in areas where members of their support groups live.
In areas where there are Shiite minorities, the Shiites have formed a single electoral list to maximise the sectarian vote; where there are no Shiites, they do not run at all. A clearer possible sign that they are focused only on sectarian support would hardly be possible.
Crucially, this state of affairs in Iraqi political positioning is not something that has been constant since the Iraq war began in 2003. Quite the contrary, we need to go back only to the previous local elections, held in 2009 to find indications of healthier tendencies.
Back then, Prime Minister Nouri Al Maliki made an honest attempt to win some Sunni votes in some areas.
Crucially, Mr Al Maliki challenged other Shiites even in the northern governorates where a common Shiite list might have maximised the sectarian vote.
Another interesting indicator of the state of play in Iraqi politics relates to parliamentary developments. Again, there are superficial indicators of a modicum of success: Recently the annual budget was passed with a slim majority, getting 168 votes in the 325-member chamber.
Here one might perhaps talk about a somewhat more progressive political climate. Kurds were boycotting in protest over oil policy, and large parts of the secular and increasingly Sunni-backed Iraqiyya were absent too.
Still, since the Kurds enjoy extensive autonomy, a bit of friction between them and the central government in the national parliament does not in itself have to be seen as some kind of anomaly or danger signal.
That Mr Al Maliki was able to win the support of some Sunnis and secularists indicates that Iraqi political life is not really completely polarised along sectarian lines.
Still, with so few Sunnis and secularists taking part in the vote, Mr Al Maliki once more relied on sectarian support from the Sadrists to get things done, and his efforts to build enduring political bonds outside his Shiite Islamist base remain alarmingly limited.
Make a comparison with July 2008, when there was evidence of a far broader Sunni-Shiite alliance on issues relating to electoral arrangements for the Kurdish-controlled disputed city of Kirkuk.
All this suggests a way to see the legacy of the Iraq war: the country briefly experienced a progressive and democratic form of politics around between 2008 and 2010, but has since relapsed into sectarianism.
This suggests that the US withdrawal from the country in December 2011 was premature: a continued US presence might well have had a positive effect on Iraq's political climate.
Even a token residual US force might have been enough to drive a wedge between Mr Al Maliki and the Sadrists, sufficient to force him to build more solid ties with parts of Iraqiyya and other Sunnis and secularists. But without the US presence, he has relied on the Sadrists, who have turned markedly towards Iran in recent years.
The change during the Obama administration has been the shift towards seeing Iranian influence in Iraq as something "natural" to which the US can acquiesce.
This tendency seems organically related to the Democrats' discourse on Iraq during their years of opposition to George W Bush, when they became wedded to the portrayal of the war as a failure and got attached to narratives that focused on partition, and the acceptance of regional overlordships, as major symptoms of the war's "failure".
It is true that some of the partners the Bush administration chose so illogically from among the Shiite political parties have given Iran a stronger foothold in Iraq than it needed to have.
But it was only during the Obama years that the ties linking all the Shiite parties of Iraq with Iranian sponsors were revived, so that they now seem stronger than ever.
The Iraq war really went bad in 2009. This point is worth emphasising since so much of the current anniversary commentary is provided by people who opted to close their eyes shortly after the onset of the war, and didn't bother to open them again until now.
The chaotic nature of the Egyptian and Tunisian revolutions suggests that Arab politicians are perfectly capable of messing things up, even when the big powers are in the back seat.
But in Iraq, for better or worse, the US intervened. Once that presence was in place, it was terminated badly and irresponsibly under Mr Obama, with grave consequences for Iraq and the wider region.
Reidar Visser is the editor of the Iraq website historiae.org and a research fellow at the Norwegian Institute of International Affairs