Washington didn't expect the implantation of democracy in Iraq to work out quite this way.
US draws down in Iraq, and Baghdad takes the reins
Washington's neocons would have you believe that the US president, Barack Obama, will serve up Iraq on a plate to a hungry Iran when he withdraws all US troops at the end of this year.
And Mr Obama's camp seems concerned to counter this charge, with an election a year away. Officials are warning Iran against "interference" in Iraq, and The New York Times reports that to counter Iran, the US will increase its troop numbers and naval strength in the Gulf after the Iraq withdrawal.
The posturing about Iran is, of course, largely for domestic consumption. Mr Obama's critics are misguided in believing that the US troop presence limits Iranian influence in Iraq, and they are also directing their complaint to the wrong address: It was not President Obama who decided to leave Iraq; he is required to do so under the Status of Forces Agreement negotiated by his predecessor in November 2008.
But if the Republicans are really looking for one man to blame for the US withdrawal it is neither President George W Bush nor Mr Obama, but Grand Ayatollah Ali Sistani, the leading Shiite cleric. He is the man who made sure key decisions about the country's future were taken democratically, by Iraqis rather than by Americans.
Paul Bremer, the American viceroy best remembered for the epic blunder of summarily dissolving the Iraqi military, fell a foul of Ayatollah Sistani in 2003 when he proposed three years of government by Iraqis hand-picked by the US, who would also write the new constitution.
The cleric - who refused ever to meet US officials lest he be deemed to be sanctifying the occupation - issued a fatwa from Najaf, dismissing Mr Bremer's plan as "fundamentally unacceptable" and insisting that Iraqis democratically elect the body that would draw up a new constitution.
Mr Bremer, seized by the heady arrogance of Bush-era empire-building, hoped to overrule Mr Sistani. But by the end of 2003, with tens of thousands of Iraqis demonstrating in support of the Ayatollah's decree, it became clear that even Mr Bremer's hand-picked Iraqi Governing Council would buckle to the election demand.
The US couldn't very well take to the streets to fight the same Iraqis it claimed to have liberated, and Mr Bremer was forced to back down. The US transferred sovereignty in 2004 and the first election was held the following January. It returned a Shiite-dominated government closer to Iran than to Washington, as did the second election, a year later (although Prime Minister Nouri Al Maliki retains his independence from both Tehran and Washington).
The idea that US troops somehow diminish Iranian influence in Iraq is hard to take seriously. Iran certainly had an agenda in Iraq; it was determined to see a friendly government replace Saddam Hussein, its most reviled and dangerous enemy, and so avoid any repeat of the disastrous eight-year war waged by Saddam against the Iranians in the 1980s. And given Iran's long-standing ties with Shiite parties in Iraq, the most effective means for achieving Iran's objective may well have been Iraqi democracy - the Shiites, on whom it could count for friendly ties, were after all an electoral majority.
So, Iran deepened political, economic and religious ties with Iraq's Shiites. It provided financial support to its political and religious allies, and military training and supplies to Shiite militias that were fighting the US and were also engaged in vicious sectarian warfare against Iraqi Sunnis.
Iran built this influence despite the presence of up to 170,000 American troops - and it used that influence to help press for the departure of US forces.
If anything, the departure of US forces removes the key pretext for Iran backing Shiite militia groups, of which Mr Maliki would like to be rid. But the possibility of escalating proxy warfare between Iran and Saudi Arabia might see such support maintained.
In the unlikely event that Iran invaded Iraq after the American withdrawal, it would find plenty of Arab Shiites ready to fight their Persian Shiite neighbours - as they did during the 1980s war. The interests of men like Mr Maliki and Muqtada Al Sadr may coincide with those of Iran at times but these men remain, at heart, fierce Iraqi nationalists.
Mr Bremer's plan had implied that the Iraqis weren't quite ready for democracy, but Ayatollah Sistani turned the question on its head, asking if the Americans were ready to abide by the election results.
To its credit, the US has done so. In 2008, when Mr Bush began negotiating a new Status of Forces Agreement, he envisaged an open- ended stay, and wanted the Iraqis to agree to 50 permanent US bases in the country. The Iraqis walked him back, setting the December 31, 2011 withdrawal deadline and rejecting permanent bases.
US officials still hoped that the Iraqis could be pressed to accept a couple of US divisions staying behind, but the Iraqis declined.
The US will certainly retain a substantial presence, with thousands of security contractors on the staff of its 17,000-person embassy in Baghdad and hundreds of soldiers in training capacities, to say nothing of covert operations.
Many perils lie ahead. Some of the Shiite militias may escalate attacks on US troops to make it look as if their military efforts drove the Americans out. But Iraqis know it was their government - Iraqi public opinion, as expressed through the democratic process - that forced the Americans to accept their terms. And if the Iraqis could prevail over the world's last superpower, they're unlikely to become a cat's paw for the lesser regional hegemon next door.
American leaders like to tell their counterparts in newly democratic societies that the iron test of democracy is whether leaders accept defeat at the polls. That's exactly what they've had to do in Iraq.
Tony Karon is an analyst based in New York. Follow him on Twitter @Tony Karon