I can't believe I was the only one paying attention when Nuri al-Maliki, the then-prime minister of Iraq with close ties to Iran, forced the U.S. to take its military out of Iraq.
Both Sunnis and Shiites saw the Americans as an occupying force. Even the pro-American former prime minister, Ayad Allawi, would not support an extension of the U.S. mission and said the troops had to leave.
Negotiations for a small force fell through because they could stay only if they were subject to Iraqi law, an obviously unacceptable condition.
In 2008, President George W. Bush had signed a Status of Forces Agreement (SOFA) with the Iraqi government, which included a stipulation that all U.S. forces would be withdrawn from Iraq by Dec. 31, 2011.
After the extension of forces negotiations fell through, this withdrawal was accomplished in compliance with the SOFA and at the insistence of the Iraqi government. You can look it up.