The US invaded Iraq in 2003 in a show of strength after 9/11 to prove it was the world's sole superpower. But the war demonstrated that the US did not have the political and military might to determine the future of Iraq.
The country that US troops leave behind is badly damaged politically, economically and psychologically. This is to be expected after the 30 years of war, civil war, sanctions and occupation. Much of the damage was done by Saddam Hussein, but much was also the result of American efforts to rule the country directly.
The US problem in Iraq was that it wanted to overthrow Saddam without seeing him replaced by Shia Islamist parties linked to Iran. This was always going to be the inevitable outcome of any democratic election, which Shia Islamists allied to the Kurds would win.
Iraq is a divided country with a constitution aimed at sharing power that has institutionalised sectarian and ethnic divisions between Shias, Sunnis and Kurds.
Iraq may be divided, violent and unstable but this does not mean it is going to split up or subside into a new civil war. All communities have an interest in getting a share of the growing oil revenues. More dangerous in the longer term may a dissatisfaction with an administration viewed as a gang of racketeers. The more oil revenues increase, the more Iraqis will wonder why economic development is so slow.
Much of the $100bn (£65bn) budget this year will be spent on salaries and pensions, but rebuilding the country, aside from Kurdistan, is slow – though oil output will grow rapidly.
US fears of Iran dominating Iraq are overblown. Iran is influential, but it is not the only outside player in Iraqi politics and there are limits to what a foreign power can do in Iraq, as the US has found.