WASHINGTON -- The Barack Obama of 2011 and the Barack Obama of 2008 don't always see eye to eye.
Typically the presidential vision has overruled the candidate's. (Extending the Bush tax cuts, supporting indefinite detention without trial and engaging in open-ended war in Afghanistan are a few examples.)
But in the case of the complete withdrawal of American troops from Iraq by the end of this year, candidate Obama prevailed over the president.
But the president ultimately had no choice but to stick to candidate Obama's plan -- thanks, of all things, to an agreement signed by George W. Bush.
What makes this turn of events even more improbable is that Bush initially intended the agreement to do precisely the opposite: to lock the next president into staying in Iraq indefinitely. But back in 2008, Iraqi government officials -- fed up with a seemingly endless U.S. occupation and emboldened by candidate Obama's vow to withdraw most combat troops within 16 months -- insisted on setting a deadline for departure.
"Bush didn't want the date certain for withdrawal at the time; that was forced by the Iraqis," said Daniel Serwer, a senior fellow at the Johns Hopkins University School of Advanced International Studies.
And three years later, "that's the same story with President Obama," Serwer said.
The agreement, dubbed the Status of Forces Agreement, was mostly negotiated in 2008, at the height of the presidential race between Obama and Sen. John McCain (R-Ariz.).
The U.N. Security Council mandate for the multinational forces in Iraq, which had been extended three times already, was due to expire at the end of 2008. Instead of trying to extend that mandate, which the Iraqis opposed, Bush instead chose to enter into bilateral negotiations.
"When they started the negotiations with Iraq, they thought they were just going to write this thing and the Iraqis were going to accept what we wrote for them," said Kenneth Katzman, a specialist in Middle Eastern Affairs at the Congressional Research Service.
"They wanted to make sure there would not a quick withdrawal. They wanted to make sure that the next president wouldn't simply abandon the effort," Katzman said. "And there was a belief when the negotiations started that the Iraqis were going to be much more pliable than they turned out to be."
Back in the U.S., however, the Democratic presidential nominee-to-be was making the case for a quick withdrawal one of the centerpieces of his campaign.
As early as February 2007, when he officially announced that he was running, Obama proclaimed: "I have a plan that will bring our combat troops home by March of 2008. Letting the Iraqis know that we will not be there forever is our last, best hope to pressure the Sunni and Shia to come to the table and find peace."
He spoke throughout the campaign about "ending the war responsibly." In a July 2008 speech, after he had secured the Democratic nomination, Obama said of Iraq: "This war distracts us from every threat that we face and so many opportunities we could seize. ... By any measure, our single-minded and open-ended focus on Iraq is not a sound strategy for keeping America safe."
The Bush-Cheney vision of the future -- which administration officials felt certain the Iraqis would accept -- was very different.
By June 2008, details of the negotiations were starting to leak out. The Independent, a British paper, reported that the Bush White House was insisting on retaining the use of more than 50 military bases in Iraq, controlling Iraqi airspace and maintaining a free hand to carry out military activities without consulting the Baghdad government.
Soon, the big news was that the American demands were infuriating Iraqi lawmakers, some of whom even threatened to kick out U.S. troops entirely.
"It was Barack Obama's proposal that the Iraqis adopted as theirs," Serwer said. "The Iraqis wanted the Barack deal, not the Bush deal."
When both sides announced a resolution in August, Bush had acceded to the Iraqis' major demands.
Most glaringly, it was a defeat for Bush to consent to precisely the kind of timetable that, when Obama and other Democrats had called for one, he repeatedly and contemptuously dismissed as schedule for surrender.
"I believe setting a deadline for withdrawal would demoralize the Iraqi people, would encourage killers across the broader Middle East and [would] send a signal that America will not keep its commitments," he had said in May 2007. "Setting a deadline for withdrawal is setting a date for failure -- and that would be irresponsible."
And although administration officials insisted that the deadline was still conditional -- "aspirational" was their term of choice -- the agreement also drove a stake through the heart of neoconservative hopes that Iraq would be a long-term staging area for the U.S. in the region.
The agreement made clear that there would be no lasting presence -- something that can be seen playing itself out now, as the U.S. military turns over to the Iraqis dozens of outsized military bases that cost U.S. taxpayers over $2 billion to build.
Back in 2008, Bush got one concession: As USA Today reported at the time, he literally bought some time. "Iraq initially wanted all combat troops out by the end of 2009, but agreed to push the date to 2011, after the U.S. agreed to protect Iraqi funds in U.S. banks from being seized by creditors," the story said.
In the end, the agreement called for a U.S. withdrawal that would be not quite as fast as Obama's 16-month schedule called for -- but its interim goal of ending combat operations in Iraqi cities by the summer of 2009 was faster than any commitment Obama had made.
Candidate Obama welcomed the news: "They are working on a plan that looks, lo and behold, like the plan that I've been advocating. I will encourage the administration to move forward with it," he said at the time.
The deal wasn't completely finalized until a few weeks after Obama won the presidency on November 4, with the Iraqis using his victory to pressure the Bush administration to make even more, last-minute concessions.
Three days after the agreement was signed, Reuters reported, the White House was still refusing to make its text public, even though it had already been published in full in an Iraqi newspaper.
There was no official announcement from the White House until the Iraqi parliament formally approved the agreement -- and even then, Bush only issued a dry, written statement.
Bush had wildly underestimated the depth of Iraqi hostility toward an indefinite American presence, Spencer Ackerman wrote in the Washington Independent. "When the definitive history of the Bush administration's prosecution of the Iraq war is written, its attempt to force the Iraqi government to sign a bilateral agreement authorizing an indefinite occupation will stand as its final massive blunder," he wrote.
McClatchy Newspapers reported that senior military officials were privately criticizing Bush "for giving Iraq more control over U.S. military operations for the next three years than the U.S. had ever contemplated" and for giving in to Iraqi demands "to avoid leaving the decisions to his successor, Barack Obama."
A few days later, in a radio address, Bush made a rare public mention of the December 2011 withdrawal date while putting a positive face on the deal. "The war in Iraq is not yet over," he said, "but thanks to these agreements and the courage of our men and women in Iraq, it is decisively on its way to being won."
Just a month before he left office, Bush flew to Baghdad, where he spent a little over seven hours on the ground and formally signed the agreement.
He told troops at Camp Victory: "The dramatic turnaround you led in Iraq culminated in the two agreements completed last month. ... These agreements show the way forward toward a historic day -- when American forces withdraw from a democratic and successful Iraq, and the war in this land is won."
But whatever Bush had to say about the agreements that day was overshadowed by a far more visceral reflection of what was going on in Iraq, when an Iraqi reporter, standing about 12 feet away, threw two shoes directly at Bush's head. With the first shoe, the man shouted in Arabic: "This is a gift from the Iraqis; this is the farewell kiss, you dog!" And with the second shoe: "This is from the widows, the orphans and those who were killed in Iraq!"
Three years later, the Obama administration also underestimated the depth of Iraqi hostility to the U.S. presence in the country. Right up until Obama's announcement last week, some administration officials were still expressing near certainty that the Iraqi government would request several thousand trainers to remain past the December 31 deadline.
But negotiations ultimately broke down over the issue of legal immunity for any remaining troops, which was an imperative for the Pentagon and a deal-breaker for the Iraqis, who after nearly nine years of U.S. military presence wanted no more infringements on their sovereignty.
As a result, Obama had no choice but to make the announcement he did on October 21. "As a candidate for President, I pledged to bring the war in Iraq to a responsible end," he said.
Obama said he had spoken to Iraqi Prime Minister Nouri al-Maliki and "reaffirmed that the United States keeps its commitments."
"So today," Obama said, "I can report that, as promised, the rest of our troops in Iraq will come home by the end of the year. After nearly nine years, America's war in Iraq will be over."
* * * * *
Think the U.S. presence in Iraq will be over on Jan. 1, 2012? Think again. Read our September 16 article about how the U.S. is simply falling back to a gargantuan embassy, where its enormous civilian presence will include a veritable army of 8,000 armed private security contractors. Think everything's coming home? Read our September 26 article about the mad dash in the desert as the U.S. military goes about giving away things that cost U.S. taxpayers billions of dollars to buy and build. And think it was all worth it? Read our October 1 article on a nearly nine-year military campaign that critics say provided lesson after lesson about what not to do ever again.
* * * * *
Dan Froomkin is senior Washington correspondent for The Huffington Post. You can send him an email, bookmark his page; subscribe to his RSS feed, follow him on Twitter, friend him on Facebook, and/or become a fan and get email alerts when he writes.